Hello all,
I've been trying to do this for a while and seem to be getting closer but could use a little help. Here is what I'm trying to do:
1. take the members of a group in Active Directory 2. Place each member of said group into maintenance mode
I've got a powershell script that will read the contents of a text file and do this, but so far I can't create the text file in a way that I can get the script to read. One option is to use the "Net Group" command which is very nice because all you do is specify the name of the group and it magicall works. The problem is it isn't a line by line output to a text file once piped to it.
Another option, and possibly the best, would be for this to exist entirely into one powershell script. So, the script would take the parameters: AD groupname, RMSname, Time in minutes of maintenance mode, comment, and you could simply use a scheduled task to do it then with one script and one command line.
Any ideas??
Thanks!! |