A konfiguráció ellenőrzése

A konfigurációt tahát rendszeresen végre lehet hajtani és mihelyst eltérés van ez előírt erőforrások beállításaiban, az LCM kijavítja ezeket. Ha csak ellenőrizni szeretnénk, hogy épp mi az aktuális konfigurációja a gépünknek, ezt a Get-DSCConfiguration cmdlettel tehetjük meg:

PS C:\> Get-DscConfiguration

 

 

ConfigurationName    : FajlRegLegyenOtt

DependsOn            :

ModuleName           : PSDesiredStateConfiguration

ModuleVersion        :

PsDscRunAsCredential :

ResourceId           : [File]Fájl

SourceInfo           :

Attributes           : {archive}

Checksum             :

Contents             :

CreatedDate          : 2015.10.31. 12:53:37

Credential           :

DestinationPath      : c:\FolderByDSC\Default.txt

Ensure               : present

Force                :

MatchSource          :

ModifiedDate         : 2015.10.02. 21:42:14

Recurse              :

Size                 : 11

SourcePath           :

SubItems             :

Type                 : file

PSComputerName       :

CimClassName         : MSFT_FileDirectoryConfiguration

 

ConfigurationName    : FajlRegLegyenOtt

DependsOn            :

ModuleName           : PsDesiredStateConfiguration

ModuleVersion        : 1.1

PsDscRunAsCredential :

ResourceId           : [Registry]Reg

SourceInfo           :

Ensure               : Present

Force                :

Hex                  :

key                  : HKLM:\SOFTWARE\SoosTibor

ValueData            : {DSC-vel létrehozva}

ValueName            : AzEnErtekem

ValueType            : String

PSComputerName       :

CimClassName         : MSFT_RegistryResource

Ebből sajnos nem derül ki, hogy most megfelel a gépünk ennek vagy sem. Viszont a Test‑DSCConfiguration  már erre is ad választ:

PS C:\> Test-DscConfiguration

True

Ez True vagy False értéket ad alaphelyzetben. Ha ennél több információ kell, akkor használhatjuk a ‑Verbose kapcsolót:

PS C:\> Test-DscConfiguration -Verbose

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters,

''methodName' = TestConfiguration,'className' =

MSFT_DSCLocalConfigurationManager,'namespaceName' =

root/Microsoft/Windows/DesiredStateConfiguration'.

VERBOSE: An LCM method call arrived from computer STLENO with user sid

S-1-5-21-2156952311-2926033462-1066486086-1000.

VERBOSE: [STLENO]: LCM:  [ Start  Test     ]

VERBOSE: [STLENO]: LCM:  [ Start  Resource ]  [[File]Fájl]

VERBOSE: [STLENO]: LCM:  [ Start  Test     ]  [[File]Fájl]

VERBOSE: [STLENO]:                            [[File]Fájl] Building file list

without using cache.

VERBOSE: [STLENO]:                            [[File]Fájl] The destination

object was found and no action is required.

VERBOSE: [STLENO]: LCM:  [ End    Test     ]  [[File]Fájl] True in 0.0040

seconds.

VERBOSE: [STLENO]: LCM:  [ End    Resource ]  [[File]Fájl]

VERBOSE: [STLENO]: LCM:  [ Start  Resource ]  [[Registry]Reg]

VERBOSE: [STLENO]: LCM:  [ Start  Test     ]  [[Registry]Reg]

VERBOSE: [STLENO]:                            [[Registry]Reg] Found registry

key value 'HKLM:\SOFTWARE\SoosTibor\AzEnErtekem' with type 'String' and data

'DSC-vel létrehozva'

VERBOSE: [STLENO]: LCM:  [ End    Test     ]  [[Registry]Reg] True in 0.0380

seconds.

VERBOSE: [STLENO]: LCM:  [ End    Resource ]  [[Registry]Reg]

VERBOSE: [STLENO]: LCM:  [ End    Test     ]     Completed processing test

operation. The operation returned True.

VERBOSE: [STLENO]: LCM:  [ End    Test     ]    in  0.1140 seconds.

VERBOSE: Operation 'Invoke CimMethod' complete.

True

VERBOSE: Time taken for configuration job to complete is 0.161 seconds

Ennek kimenete nagyon hasonló a Start-DSCConfiguration verbose kimenetéhez. A –Detailed kimenet a Get-DSCConfiguration kimenetéhez hasonló, csak az kiegészül erőforrásonként egy InDesiredState tulajdonsággal is:

PS C:\> $result = Test-DscConfiguration -Detailed

PS C:\> $result

 

PSComputerName  ResourcesInDesiredState        ResourcesNotInDesiredState

--------------  -----------------------        --------------------------

localhost       {[File]Fájl, [Registry]Reg}

 

 

PS C:\> $result.ResourcesInDesiredState

 

 

ConfigurationName    : FajlRegLegyenOtt

DependsOn            :

ModuleName           : PSDesiredStateConfiguration

ModuleVersion        : 1.1

PsDscRunAsCredential :

ResourceId           : [File]Fájl

SourceInfo           : ::3::9::File

DurationInSeconds    : 0,008

Error                :

FinalState           :

InDesiredState       : True

InitialState         :

InstanceName         : Fájl

RebootRequested      : False

ResourceName         : File

StartDate            : 2015.10.31. 16:42:24

PSComputerName       : localhost

 

ConfigurationName    : FajlRegLegyenOtt

DependsOn            :

ModuleName           : PsDesiredStateConfiguration

ModuleVersion        : 1.1

PsDscRunAsCredential :

ResourceId           : [Registry]Reg

SourceInfo           : ::11::9::Registry

DurationInSeconds    : 0,251

Error                :

FinalState           :

InDesiredState       : True

InitialState         :

InstanceName         : Reg

RebootRequested      : False

ResourceName         : Registry

StartDate            : 2015.10.31. 16:42:24

PSComputerName       : localhost



Word To HTML Converter