Show MenuHide Menu

Tag: WMI

Windows Management Framework 3.0 – Community Technology Preview 1

September 21, 2011

The WMF 3.0 CTP1 for Windows 7 SP1 and Windows Server 2008 R2 SP1 (download) is out (was published yesterday) and brings updated management functionality. It contains Windows PowerShell 3.0 and new versions of WMI and WinRM. Please note that a CTP isn’t a final release but a preview release. It is designed to enable the community to experience and review the preliminary designs and direction of key features and to solicit feedback before features are finalized.

Some of the new features in Windows PowerShell 3.0 enable Service Providers to automatically build, maintain, and administer IT Infrastructures. With WMF 3.0 including PowerShell 3.0, WMI, and WinRM, Microsoft addresses the increasing need for automation driven by the era of Cloud Computing.

Working with local administrator

February 17, 2010

When working with local administrator account, there are 3 possible tasks you usually want to accomplish:

1.) Change password

2.) Rename account

3.) Disable\Enable account

Below are snippets of Powershell code that can help you to achieve that. First line is always used to retrieve local account with RID 500 (built-in administrator account, no matter what is the name), rest than depends on what you want to achieve.

1.) Change password

2.) Rename account

3.) Disable\Enable account


How To Reset A Wireless Network Adapter?

March 15, 2009

I switch between wireless networks frequently. Usually I am facing issues with getting connected which get resolved by clicking around in Vista’s Network and Sharing Center. As this takes always a couple of minutes I want a PowerShell script that I can use to reset my wireless lan adapter directly.

This can be accomplished using WMI:

How To Map A Network Printer?

July 14, 2008

If you want to add a network printer connection with PowerShell try one of the following ways:

Printui.dll Call

Use WshNetwork’s AddWindowsPrinterConnection method

Use WMI Win32_Printer’s AddPrinterConnection method

How To Retrieve The UUID/GUID From A Computer?

August 28, 2006

The VBScript function below, GetUUID, shows how to retrieve the UUID/GUID from a computer.

How To Enable DHCP Completely?

July 19, 2006

The Sub procedure below uses WMI in order to set the network adapter’s IP configuration to DHCP, not only for IP address, IP gateway, and subnet mask, but also for both DNS server search order and WINS servers:

If you omit the SetDNSServerSearchOrder and SetWINSServer statements the previously configured DNS and WINS servers will remain in the network adapter’s IP configuration.

How To Determine The Name Of The Local Administrator Group?

January 17, 2006

The VBScript below, LocalAdminGroup.vbs, determines the name of the local administrator group by searching its SID in the list of local groups.

See also: Well-known security identifiers in Windows operating systems

How To Test WMI Connectivity?

September 10, 2005

The VBScript file below, WMIPing.vbs, checks if connection to WMI of the target system can be established.

WMIPing.vbs exits with an errorlevel:

  • 0 = WMI Ping succeeded successfully
  • 1 = ICMP Ping failed, WMI Ping omitted
  • 2 = WMI Ping failed