Mike Satterfield
asked on
VB Login Script that removes the user logging in from specific AD group
I am not a great coder, and am a bit under a time crunch. I am writing a login script that needs to, check if the user is part of a specific group, delete all network printers if they are, then remove that user from the group.
I have the first two parts working, but am not having an easy time removing the user form the group. I do understand the users will need the proper AD permissions, I am testing with a Domain administrator account now. I am attaching what I have so far:
Thanks,
login-script-test3.vbs
I have the first two parts working, but am not having an easy time removing the user form the group. I do understand the users will need the proper AD permissions, I am testing with a Domain administrator account now. I am attaching what I have so far:
Thanks,
login-script-test3.vbs
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nevermind.. .just needed to swap computername with username.. everything works great.. then thanks.
Great!
ASKER
on the line:
objGroup.Remove("LDAP://" & objADSysInfo.ComputerName)
I do have the group, having self add/remove rights, as well as the user, in the groups permissions. .. Am I missing something else rigths wise ?
Thanks,