Network Adapters–Disable/Enable
Posted by: Richard Siddaway
Last time we saw the Get-NetAdapter cmdlet from the NetAdapter module
PS> Get-NetAdapter | ft Name, InterfaceDescription, Status -a
Name ...
Last time we saw the Get-NetAdapter cmdlet from the NetAdapter module
PS> Get-NetAdapter | ft Name, InterfaceDescription, Status -a
Name ...
The WMI classes Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration have seen a lot of use over the years. They can be a bit fiddly to use which is why the NetAdapter module in Windows 8/2012 is a so welcome.
Lets start by looking at basic information gathering
PS>...
When you used the WMI cmdlets
Get-WmiObject -Class Win32_logicalDisk -ComputerName RSLAPTOP01
You were using DCOM to access the remote machine. Even if you accessed the local machine you were using DCOM.
This changes in PowerShell v3 when using the CIM cmdlets.
If...
I’ve been grading the scripts in the warm up events for the Scripting Games and noticed a lot of people doing this:
Get-WmiObject -Class Win32_LogicalDisk | where {$_.DriveType -eq 3}
Ok now it works but there are a couple of things wrong with this approach.
Firstly,...
Ok the embarrassing moral of this story is that you shouldn't answer questions in a hurry at the end of the evening. 5 minutes after shutting down I realised that there is a far, far simpler way to get the info. Win32_AccountSID is a WMI linking class. It links Win32_SystemAccount and Win32_SID...
I realised there is an easier way to get the data
function get-SID { param ( ...
A question on the forum asked about finding the accounts and SIDs on the local machine.
function get-SID { param
WMI enables you find the number of processors in your system:
PS> Get-WmiObject -Class Win32_ComputerSystem | fl Number*
NumberOfLogicalProcessors : 2
NumberOfProcessors : 1
This works fine for Windows...
A forum question regarding retrieving WMI based data from multiple servers and displaying it as HTML was interesting. I would approach it like this
$servers = Get-Content...
One thing that I don’t think I’ve mentioned is that the Get-CimClass output changed during the development process.
In PowerShell v3 RTM you can dig into a WMI class like this
Get-CimClass -ClassName Win32_OperatingSystem | select -ExpandProperty CimClassMethods
