Showing posts with label Group Policy. Show all posts
Showing posts with label Group Policy. Show all posts

Wednesday, December 17, 2008

Enumerating Resultant Set of Policy System Services

Returns information about the service settings (including startup mode and access permissions) assigned to a computer by using Group Policy

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery("Select * from RSOP_SystemService")
For Each objItem in colItems
    Wscript.Echo "Service: " & objItem.Service
    Wscript.Echo "Precedence: " & objItem.Precedence
    Wscript.Echo "SDDL String: " & objItem.SDDLString
    Wscript.Echo "Startup Mode: " & objItem.StartupMode
    Wscript.Echo
Next

This is a VB Script, this can be used by saving the file in .vbs file

Enumerating Resultant Set of Policy Security Settings -- Numeric

Returns information about account policy settings assigned by using Group Policy

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
    ("Select * from RSOP_SecuritySettingNumeric")
For Each objItem in colItems
    Wscript.Echo "Key Name: " & objItem.KeyName
    Wscript.Echo "Precedence: " & objItem.Precedence
    Wscript.Echo "Setting: " & objItem.Setting
    Wscript.Echo
Next

This is a VB Script, this can be used by saving the file in .vbs file

Enumerating Resultant Set of Policy Security Settings -- Boolean

Returns information about account policy settings (such as password policy settings and account lockout policy settings) assigned by using Group Policy

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
    ("Select * from RSOP_SecuritySettingBoolean")
For Each objItem in colItems
    Wscript.Echo "Key Name: " & objItem.KeyName
    Wscript.Echo "Precedence: " & objItem.Precedence
    Wscript.Echo "Setting: " & objItem.Setting
    Wscript.Echo
Next

This is a VB Script, this can be used by saving the file in .vbs file

Enumerating Resultant Set of Policy Security Event Log Settings -- Numeric

Returns information about event log settings (such as maximum log size) assigned by using Group Policy

Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
    ("Select * from RSOP_SecurityEventLogSettingNumeric")
For Each objItem in colItems
    Wscript.Echo "Key Name: " & objItem.KeyName
    Wscript.Echo "Precedence: " & objItem.Precedence
    Wscript.Echo "Setting: " & objItem.Setting
    Wscript.Echo "Type: " & objItem.Type
    Wscript.Echo
Next

This is a VB Script, this can be used by saving the file in .vbs file

Enumerating Resultant Set of Policy Security Event Log Settings -- Boolean

Returns information about access to event logs assigned by using Group Policy

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
    ("Select * from RSOP_SecurityEventLogSettingBoolean")
For Each objItem in colItems
    Wscript.Echo "Key Name: " & objItem.KeyName
    Wscript.Echo "Precedence: " & objItem.Precedence
    Wscript.Echo "Setting: " & objItem.Setting
    Wscript.Echo "Type: " & objItem.Type
    Wscript.Echo
Next

This is a VB Script, this can be used by saving the file in .vbs file

Enumerating Resultant Set of Policy Scopes of Management

Returns information about the Scope of Management (SOM) used in applying Group Policy to a computer. To return information about Group Policy applied to the logged-on user, change the WMI class from root\rsop\computer to root\rsop\user

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery("Select * from RSOP_SOM")
For Each objItem in colItems
    Wscript.Echo "ID: " & objItem.ID
    Wscript.Echo "Blocked: " & objItem.Blocked
    Wscript.Echo "Blocking: " & objItem.Blocking
    Wscript.Echo "Reason: " & objItem.Reason
    Wscript.Echo "SOM Order: " & objItem.SOMOrder
    Wscript.Echo "Type: " & objItem.Type
    Wscript.Echo
Next

This is a VB Script, this can be used by saving the file in .vbs file

Wednesday, December 3, 2008

How to Enable WINLOGON Logging

Logging for the Microsoft Windows Security Configuration Client (also known as "SceCli") component during Group Policy processing helps in troubleshooting user rights, group memberships and security policies, (for example, password policy or account restrictions) that have been set using Group Policies.

245422 How to Enable Logging for Security Configuration Client Processing in
http://support.microsoft.com/?id=245422

Value Path: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{827D319E-6EAC-11D2-A4EA-00C04F79F83A}
Value Name: ExtensionDebugLevel
Value Type: REG_DWORD
Value Data: 2 (hex)
Output: %Systemroot%\security\logs\winlogon.log
Note: 
To immediately generate logging output, type the following command at a command prompt on the client:
On Windows 2000:
"secedit /refreshpolicy machine_policy /enforce" (without the quotation marks)
On Windows XP and 2003:
"gpupdate /force" (without the quotation marks)

How to Enable USERENV Logging

Userenv logging is useful in troubleshooting and debugging problems with roaming profiles and system policies.

221833 How to enable user environment debug logging in retail builds of Windows
http://support.microsoft.com/?id=221833

Value Path: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Value Name: UserEnvDebugLevel
Value Type: REG_DWORD
Value Data: 10002 (hex)
Output: %Systemroot%\Debug\UserMode\Userenv.log

How to Enable logging for Folder Redirection

In addition to logging events in the Application Event log, Folder Redirection can provide a detailed log to aid troubleshooting.

Public URL: http://www.microsoft.com/technet/community/newsgroups/upfrfaq.mspx

Value Path: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Diagnostics
Value Name: FdeployDebugLevel
Value Type: REG_DWORD
Value Data: F (hex)
Output: %systemroot%\debug\usermode\fdeploy.log

How to Enable Application Management Logs

When a program that is deployed through Group Policy is not installed correctly on a client computer, a log file can be generated that records the steps of the Group Policy Application Deployment component leading up to the unsuccessful installation. This information, in conjunction with logging from the Windows Installer service, can be very helpful in determining the cause of the problem.

KB article: 246509
Public URL: 246509 Troubleshooting Program Deployment By Using Verbose Logging
http://support.microsoft.com/?id=246509

Value Path: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Diagnostics
Value Name: AppMgmtDebugLevel
Value Type: REG_DWORD
Value Data: 4B (hex)
Note: You may need to create the Diagnostics key.
Output: %systemroot%\debug\usermode\appmgmt.log