joshiieeii Posted April 5, 2007 Posted April 5, 2007 (edited) Trying to remove the Administrator account from the Administrators group in VISTA. I tried the "net" method and get a 1371 error even when running as administrator. I am convinced the only way is through WMI. I have tried the below code in various configurations, with no luck. Anyone have any ideas?;Remove Administrator for Administrators Group Dim $objgroup = ObjGet("WinNT://" & @ComputerName & "/Administrators") Dim $objuser = ObjGet("WinNT://" & @ComputerName & "/Administrator") $objgroup.remove($objuser)oÝ÷ ØZ½æ¥²kçb·Ø^«-)Þ)¶¬jëh×6$objgroup.remove($objuser.ADsPath)All the times I have tried, I keep getting a "The requested action with this object has failed." It references the last line.I can do it manually, but for some reason I can't script it.According to the MS site, I am formatting it correctly: IADsGroup::Remove Edited April 5, 2007 by joshiieeii Projects:Vista Gui ImageX Deployment Tool - CompletedActive Directory Helper - CompletedGlobalized Outlook and OWA Signature Project - Completed
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now