Category Archives: PowerShell and CIM

DiskPart and PowerShell–part 1

An attendee at the Summit made the statement that the DiskPart utility didn’t have any equivalent in PowerShell. That’s not strictly true as the storage module provides a lot of functionality that maps to diskpart functionality. The module contents include: … Continue reading

Posted in CDXML, Powershell, PowerShell and CIM | Leave a comment

Name mismatch

Ever wondered why you can’t do this: Get-ADComputer -Filter * -SearchBase ‘OU=Servers,DC=Manticore,DC=org’ | Get-CimInstance -ClassName Win32_OperatingSystem The –ComputerName parameter on get-CimInstance accepts pipeline input BUT its by property name. PS> Get-Help Get-CimInstance -Parameter ComputerName -ComputerName [<String[]>]     Specifies computer on … Continue reading

Posted in PowerShell and Active Directory, PowerShell and CIM | Leave a comment

Get-SupportedFileSystems

I stumbled on the Get-SupportedFileSystems cmdlet today. Its part of the Storage module and is defined as a function. Digging a bit further its from a CDXML module based on a CIM class. But which CDXML file contains the definition? … Continue reading

Posted in CDXML, CIM, Powershell, PowerShell and CIM | Leave a comment

Finding DNS static records

An interesting question from the forums about finding DNS static records You can view the records in a DNS zone Get-CimInstance -Namespace root\MicrosoftDNS -ClassName MicrosoftDNs_Atype -ComputerName W16DC01  -Filter “DomainName = ‘manticore.org’” | select OwnerName, Timestamp, IPAddress but how do you … Continue reading

Posted in DNS, Powershell, PowerShell and CIM | Leave a comment

wmic deprecated

I saw a forum post today where the question involved the use of the wmi command line tool wmic. Wmic was deprecated in Windows Server 2012 – https://technet.microsoft.com/en-us/library/hh831568(v=ws.11).aspx. It will eventually be removed. You should use the CIM cmdlets instead … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI | Leave a comment

Applying updates through WSUS

I like to keep the virtual machines in my test lab up to date so have a WSUS server to download and manage updates. The difficulty is applying the updates. With Windows 2012 R2 I used a module that would … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI, Windows Server 2016, WSUS | Leave a comment

ComputerName parameters for CIM and WMI cmdlets

Accessing a remote system and running Get-WmiObject -ClassName Win32_LogicalDisk -ComputerName $computer or Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName $computer is a standard approach. If you’re creating a function with that code in you may put the local machine as a default parameter: … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI | Leave a comment