PowerShell for Windows Admins:

Powershell


June 26, 2017  10:10 AM

Generating passwords

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
"Computer security", Password, Powershell

June 14, 2017  1:43 PM

Deal of the Day – 15 June 2017

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Books, Hyper-V, Powershell

My book is Manning’s Deal of the Day  - 15 June 2017: Half off Learn Hyper-V in a Month of Lunches. Use code dotd061517au at http://bit.ly/2rZXI9x Sign up for DoD notifications at https://www.manning.com/dotd


June 12, 2017  7:57 AM

Find the logged on user

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell, WMI

One method of finding the logged on users is to use CIM

$ComputerName = $env:COMPUTERNAME
Get-CimInstance -ClassName Win32_Process -ComputerName $ComputerName -Filter "Name = 'explorer.exe'" | 
foreach {
    
    $lguser = Invoke-CimMethod -InputObject $psitem -MethodName...


May 31, 2017  4:42 PM

Get-PhysicalDisk options

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

These are the Get-PhysicalDisk options for identifying the disk you want -UniqueId <string> -ObjectId <string> -FriendlyName <string> -InputObject <CimInstance#MSFT_PhysicalDisk> -StorageSubsystem <CimInstance#MSFT_StorageSubsystem> -StorageEnclosure...


May 30, 2017  1:55 PM

String casing

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

There are times when you may want to change string casing. You have a couple of options. There are a couple of methods on the string class that you can use to modify the case of a string.

PS> 'aaa'.ToUpper()
AAA

PS> 'AAA'.ToLower()
aaa
Alternatively you can use the...


May 29, 2017  12:51 PM

Build a better pull server

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Desired State Configuration, Powershell

DSC functions in 2 modes – push (most basic) and pull. Creating a pull server is a non-trivial task and the out-of-the-box pull server has some issues. Some of the folks at powershell.org have decided its time to build a better pull server. There’s a project on github that supplies the code...


May 26, 2017  8:53 AM

Diskpart and PowerShell – part 6: Multiple partitions on a disk

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

So far we’ve looked at creating a single partition on a disk. This time we’ll look at how you can create multiple partitions on a disk. The are good reasons not to do this but its something I’ve seen done on a frequent basis. Lets create a 20GB disk as an example and mount it

New-VHD...


May 23, 2017  11:35 AM

PowerShell in Azure Cloud Shell

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Azure, Powershell

if you are an Azure user see this post from the PowerShell team about the Azure Cloud Shell - 0 Comments     RSS Feed     Email a friend


May 22, 2017  1:11 PM

Diskpart and PowerShell – part4: Remove a partition

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

So far you’ve seen how to create and modify partitions and volumes. Its now time to look at how you remove a partition. Mount the test VHD

Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD
You can’t remove a volume – you have to remove the partition. Identifying the CORRECT...


May 21, 2017  1:50 PM

Diskpart and PowerShell–part 4: Expand a volume

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

You've seen how to create a volume but how do you expand a volume? Let’s create a new disk and mount it

New-VHD -Path C:\test\Test1.vhdx -Dynamic -SizeBytes 20GB
Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD
Initialize-Disk -Number 1
This time we’ll create a volume that...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: