Today I had to add a new hire to all the local Administrators group of all our dev and test servers.
So I wrote a script to do this:
Given the churn rate, it probably makes sense to actually write a proper script, that takes values such as username and hostname and does it remotely, but I just hope that it won't be me running this next time :)
$group =[ADSI]"WinNT://$(hostname)/Administrators,group"This could be improved in so many ways that I hesitate it to even call it a script but there you go.
$group.psbase.Invoke("Add",([ADSI]"WinNT://contoso/bobsmith").path)
Given the churn rate, it probably makes sense to actually write a proper script, that takes values such as username and hostname and does it remotely, but I just hope that it won't be me running this next time :)
No comments:
Post a Comment