Showing tag results for Windows PowerShell

Jul 19, 2013
Post comments count0
Post likes count0

PowerTip: Get the Number of Items in a Hash Table

Doctor Scripto

Summary: Learn how to get the number of items in a Windows PowerShell hash table.  How can I find the number of key/value pairs that a Windows PowerShell hash table contains?  Use the Count property: PS C:\> $hash = @{'a' = 1; 'b' = 2; 'c' = 3; 'd' = 4} PS C:\> $hash   Name       &nb...

Scripting Guy!Windows PowerShellPowerTip
Jul 19, 2013
Post comments count0
Post likes count0

Use PowerShell to Create First and Last Names for Test Users

Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to create first and last names in Active Directory for test users.  Hey, Scripting Guy! I have a test environment set up, and I created a bunch of users in an organizational unit in Active Directory. But I only created the user name—I did not create the firs...

Scripting Guy!Windows PowerShellActive Directory
Jul 18, 2013
Post comments count0
Post likes count0

PowerTip: Find Number Elements in a PowerShell Array

Doctor Scripto

Summary: Easily find the number of elements in a Windows PowerShell array.  How can I find how many elements are in a Windows PowerShell array?  You can find the number of elements in a Windows PowerShell array in the following ways: [array]$a = 1,2,3,4,5 $a.Count $a.Length $a.GetUpperBound(0)

Scripting Guy!Windows PowerShellPowerTip
Jul 18, 2013
Post comments count0
Post likes count0

Use PowerShell to Set AD DS Users’ Display Names

Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to set the users’ display names in Active Directory Domain Services.  Hey, Scripting Guy! I have a number of user names that were hastily created. I thought at first they were going to be temporary workers, but it seems that temporary is hanging around a lot...

Scripting Guy!Windows PowerShellActive Directory
Jul 17, 2013
Post comments count0
Post likes count0

PowerTip: Use PowerShell to Return Random Computer Names

Doctor Scripto

Summary: Learn how to use Windows PowerShell to return random computer names from Active Directory.  How can I easily obtain random computer names in Active Directory for audit purposes?  Use the Get-ADComputer cmdlet and pipe the results to the Get-Random cmdlet. The following script selects two random computer names ...

Scripting Guy!Windows PowerShellPowerTip