-
I have heard some discussions recently regarding whether Win32_LogicalDisk or Win32_Volume should be used in the answer to event 3 in the Scripting Games. The problem requires you pull the drive letter, drive size and freespace for local disks on the...
-
In event 3 you have to get information on hard disk capacity. I’ve only looked at the first couple of dozen scripts but seen this too many times Get-WmiObject -Class Win32_LogicalDisk | where DriveType -eq 3 or if you prefer the version 2 way Get...
-
There are some good features to this script but what really hurts is the two trips to the server for the Win32_Computersystem class Foreach ($IP in (Get-Content "C:\IPList.txt")) { $Name = (Get-WMIObject Win32_ComputerSystem -ComputerName $ip...
-
I haven’t finished blogging about event 1 yet but this caught my eye. Things aren’t too bad until we hit the bunch of write-host calls $wrks = (Get-Content -path C:\IPList.txt) foreach ($wrk in $wrks) { $osver = Get-WMIObject...
-
The next step on our journey to an alternative configuration is setting the NIC to use DHCP I will keep cheating for now and specify the NIC – on my machine I now it is the NIC whose Win32_NetworkAdapterConfiguration has an Index of 7 $index = 7 Get-WmiObject...
-
Manning have PowerShell in Practice on a half price offer today. Go to www.manning.com and use code dotd0330cc when ordering Read More...
-
We’ve seen a few things we can do with the WMI provider for Active Directory. One of the most useful is testing replication function test-replication { [ CmdletBinding ( ) ] param ( [string] $computername = $env:COMPUTERNAME ) Get-WmiObject -Namespace...