Hi scripters around the globe
This script shows all computer policies. How can get the policies for the user logged on??
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery("Select * from RSOP_GPO")
For Each objItem in colItems
allgpo = allgpo & objItem.Name
Next
wscript.echo allgpo
I Tried the following scripts but the all failed to work.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\rsop\user\USERSID")
Set colItems = objWMIService.ExecQuery("Select * from RSOP_GPO")
For Each objItem in colItems
allgpo = allgpo & objItem.Name
Next
wscript.echo allgpo
Thanx to you all in advance!
Alex
This script shows all computer policies. How can get the policies for the user logged on??
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery("Select * from RSOP_GPO")
For Each objItem in colItems
allgpo = allgpo & objItem.Name
Next
wscript.echo allgpo
I Tried the following scripts but the all failed to work.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\rsop\user\USERSID")
Set colItems = objWMIService.ExecQuery("Select * from RSOP_GPO")
For Each objItem in colItems
allgpo = allgpo & objItem.Name
Next
wscript.echo allgpo
Thanx to you all in advance!
Alex