PowerShell for Windows Admins:

Powershell


February 18, 2015  1:31 PM

Copy a file with WMI

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

A question came up on the forum about copying files with CIM (WMI). I normally use Copy-Item rather than CIM as its easier. The questioner was using CIM_LogicalFile when I’ve normally used CIM_DataFile so I decided to take a look at the class. In reality the two classes are very similar and...

February 17, 2015  1:37 PM

Shutting down machines in parallel

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

My test lab is a set of virtual machines running on a Lenovo w1510 laptop. When I’ve finished working for the day I want to shut down the virtual machines and the laptop. I may have anywhere between 2 and 8 (or more) VMs running so scripting the shutdown helps a lot. Machines can be shutdown...


February 16, 2015  12:23 PM

Testing AD replication

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

I thought that using a workflow with its foreach –parallel construct would be a good way to test AD replication. I found that I got double the results – the foreach seemed to go to each machine twice. Eventually decided to perform the task sequentially Get-ADDomainController -Filter *...


February 15, 2015  3:27 AM

Typing variables

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I was recently asked a question about typing variables after thinking about it came up with this demonstration. Create a variable with an integer value £> $a = 2 £> $a.GetType() IsPublic IsSerial Name -------- -------- ---- True     True     Int32 AS you would...


February 14, 2015  5:42 AM

Modifying AD attribute – PO Box

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

I was left a question on this post -

    0 Comments     RSS Feed     Email a friend


February 10, 2015  1:36 PM

Starting VMs based on WSUS state

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

I use WSUS in my lab to update machines – means I only have to download updates once. The issue is that I have to start the VMs so they can communicate with the WSUS server. WSUS will start to flag warnings if machines haven’t contacted the WSUS server for more than that length of...


February 9, 2015  12:21 PM

Error when AD object not found

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

This one popes up quite frequently If you attempt to access an Active Directory object that doesn’t exist you get an error. £> Get-ADUser Richardp Get-ADUser : Cannot find an object with identity: 'Richardp' under: 'DC=Manticore,DC=org'. At line:1 char:1 + Get-ADUser Richardp +...


February 7, 2015  9:39 AM

Stages of panic

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

You’re working on a new script and something’s not working properly and you can’t figure it out. Panic level 1 is when you start using Get-Command and Get-member on everything in sight trying to figure out what’s wrong with the objects Panic level 2 is when you realise you have to...


February 6, 2015  2:17 PM

Workflow for last logon

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

PowerShell Workflows have been a bit of an underachiever in terms of their adoption and use. Something I read prompted the thought that there are a number of activities when working with Active Directory where you have to interrogate a number of machines to get the result. That’s something...


February 5, 2015  9:57 AM

Scripting Guy CDXML series finished

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

My CDXML series on the Scripting Guy blog finished today.  The 4 articles are:

    0 Comments     RSS Feed     Email a friend


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: