Showing results for Windows PowerShell - Scripting Blog [archived]

Jul 29, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Can I Add a User to Multiple Groups?

ScriptingGuy1
ScriptingGuy1

Hey Scripting Guy! It seems that I can never find what I need anymore. I am looking for a Windows PowerShell script that will add a user to multiple groups. The user and the group are in the same organizational unit, and I do not want to have to run the same script multiple times to add a user to multiple groups. It should be easy to do, right?-- W...

Scripting Guy!Windows PowerShellActive Directory
Jul 28, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Do I Remove All Group Members in Active Directory?

ScriptingGuy1
ScriptingGuy1

Hey Scripting Guy! I have several groups created in Active Directory whose membership has changed dramatically. Rather than go through a long list of users and try to manually clean up the list, I would like to just delete all the users from the group so that I can later add the newly approved members to the group. I have checked around, and there ...

Scripting Guy!Windows PowerShellActive Directory
Jul 27, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Can I Create Organizational Units with Windows PowerShell?

ScriptingGuy1
ScriptingGuy1

(Note  Today’s response is taken from Ed Wilson’s book, Windows PowerShell Step by Step, which is available on Microsoft Press.)Hey, Scripting Guy! At my company, we are often called upon to create objects in Active Directory. I do not mind using the Active Directory Users and Computers tool. It’s kind of fun to use. We have ...

Scripting Guy!Windows PowerShellActive Directory
Jul 23, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Can I Test the Efficacy of My Script Modifications?

ScriptingGuy1
ScriptingGuy1

 Hey Scripting Guy! I have a script that I wrote, and I am interested in modifying it to try and make it run faster. I know I can use the Measure-Object Windows PowerShell cmdlet, but I want to run the script several times and get the average time it takes for each script to run. This task sounds like it might be a bit more complicated than I ...

Scripting Guy!Windows PowerShellscripting techniques
Jul 22, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Can I Speed Up My Windows PowerShell Scripts?

ScriptingGuy1
ScriptingGuy1

 Hey Scripting Guy! I am not sure why you are so excited about Windows PowerShell. It is much slower than VBScript. I am not talking about a little slow; I am talking about orders of magnitude slower. Sure it has some nice cmdlets, but the performance is sucking fumes. -- LMHello LM, It is no secret that Windows PowerShell 1.0 was a bit slow...

Scripting Guy!Windows PowerShellscripting techniques