- Home
·
- Miscellaneous
·
- checks if user is in group then adds user to local admins on PC
checks if user is in group then adds user to local admins on PC
checks if user is in group then adds user to local admins on PC
Rate checks if user is in group then adds user to local admins on PC
(1(1 Vote))
strDomain = objWshNet.UserDomain
strComputer = objWshNet.ComputerName
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
' Configure to add a domain user to the Local Administrators Group
strUser = objWshNet.UserName
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
set objDomaingroup = getobject("LDAP://CN=WKLocalAdmin,OU=Groups,DC=home,DC=com")
If objDomaingroup.IsMember(objUser.ADsPath) Then
objGroup.Add(objUser.ADsPath)
End If
'If Not objGroup.IsMember(objUser.ADsPath) Then
' objGroup.Add(objUser.ADsPath)
' End If
checks if user is in group then adds user to local admins on PC Comments
No comments yet — be the first to post one!
Post a Comment