RMP
2007-05-17 17:31:01 UTC
I want to apply a user-based GPO based on computer group membership using a
WMI filter. I have a WMI query to check for group membership except I cannot
determine how to specify a variable for the current computername to put in
the query. What I need is a way to substitute 'CurrentComputername$' with
something like '%computername%$' in the following WMI filter. This obviously
easy enough to do in a normal vbscript, but I don't know if it is possible to
environment variables or any kind of variable in a GPO WMI filter
Select * FROM Win32_GroupUser WHERE GroupComponent =
"Win32_Group.Domain='MyDomain',Name='MyComputerGroup'" And PartComponent =
"Win32_UserAccount.Domain='MyDomain',Name='CurrentComputername$'"
WMI filter. I have a WMI query to check for group membership except I cannot
determine how to specify a variable for the current computername to put in
the query. What I need is a way to substitute 'CurrentComputername$' with
something like '%computername%$' in the following WMI filter. This obviously
easy enough to do in a normal vbscript, but I don't know if it is possible to
environment variables or any kind of variable in a GPO WMI filter
Select * FROM Win32_GroupUser WHERE GroupComponent =
"Win32_Group.Domain='MyDomain',Name='MyComputerGroup'" And PartComponent =
"Win32_UserAccount.Domain='MyDomain',Name='CurrentComputername$'"