Monthly Archives: June 2015

Open Master Control Panel using PowerShell

This easter-egg or hidden control panel can be accessed by referencing its GUID. The Master Control panel is also known as GodMode, and has been referenced so often that it even has its own Wikipedia page now.

GodMode

It works by using a special GUID that gives access to almost all administrative tasks that are possible on a Windows system from a single window. Opening a control panel item by referencing a GUID is something that is supported by Microsoft. For example opening the ‘Mouse Properties’ control panel app can be done as shown in the next example:

1
explorer.exe --% shell:::{6C8EEC18-8D75-41B2-A177-8831D59D2D50}

The –% is used to escape any characters that come after it, this is done to ensure the brackets are not processed as a script block. This alternative notation achieves the same result:

1
explorer.exe shell:::`{6C8EEC18-8D75-41B2-A177-8831D59D2D50`}

Now if we would like to open the Master Control Panel, the following code can be executed:

1
explorer.exe --% shell:::{ED7BA470-8E54-465E-825C-99712043E01C}

It is also possible to create a special folder to be able to open this folder straight from your desk, the next code sample will create this folder for you:

1
2
3
'GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}' | ForEach-Object {
    New-Item -ItemType Directory -Path (Join-Path $env:userprofile\desktop $_)
}

For more information about GUID and the related articles or about the Master Control Panel or GodMode have a look at the following links:

Master Control Panel
Canonical Names of Control Panel Items
Windows Master Control Panel shortcut
Share

New article on PowerShell Magazine: Get last login date for local account

LastLogon

Two weeks ago I wrote Get-LocalLastLogonTime and blogged about this. In this script I use the [adsi] type accelerator in combination with the WinNT provider to retrieve the LastLogin property of a user account. I wrote a short article on this for PowerShell Magazine : Get last login date for local account

1
([ADSI]"WinNT://computer/jaapbrasser").lastlogin

For more articles like this, have a look at the External Articles section of my blog, it contains all the articles I have posted on external sources such as PowerShell Magazine.

Links in this Article
PSTip: Get last login date for local account
PowerShell Magazine
External Articles
My entries in TechNet Script Gallery
Get-LocalLastLogonTime
Share

New article on PowerShell Magazine: Use Shell.Application to determine which folder is open in File Explorer

Explorer

To determine which Windows are currently open in Explorer the Shell.Application Com Object can be used. Specifically the Windows() method of this object. It can retrieve the open Windows of both explorer as well as Internet Explorer. The full article  is available on PowerShell Magazine : Use Shell.Application to determine which folder is open in File Explorer

1
2
3
$ShellApp = New-Object -ComObject Shell.Application
$ShellApp.Windows() | Where-Object {$_.Name -eq 'File Explorer'} | 
Select-Object LocationName,LocationURL

For more articles like this, have a look at the External Articles section of my blog, it contains all the articles I have posted on external sources such as PowerShell Magazine.

Links in this Article
PSTip: Use Shell.Application to determine which folder is open in File Explorer
PowerShell Magazine
External Articles
Share

Free ebook – Active Directory Friday All Articles

ADF-AllArticles

The Active Directory Friday articles have proven to be quite popular among my readers and as a thank you to all my readers I decided to publish the series as an Ebook. The reason for publishing this series as an ebook is to make the content more easily accessible. The ebook is available in PDF, EPUB and MOBI formats to allow for complete portability and free choice for any device to read these articles upon. I have placed this ebook in the Books section of my blog and the download links are available below.

PDF_download Download PDF EPub_logo Download EPUB mobi Download MOBI

The ebook covers the following topics:

  • Creating Active Directory groups using PowerShell
  • Determine the forest functional level
  • Find empty Organizational Unit
  • Use the ANR filter for LDAP Queries
  • Find users with password never expires
  • Change a user’s password
  • Create new OU
  • Determine tombstone lifetime
  • Search for computers accounts
  • List password information for Domain Administrators
  • Get DistinguishedName of current domain
  • Query Group Policy Objects in Active Directory
  • Find user accounts that have not changed password in 90 days

This resource will be updated on a regular basis as new articles are published, to keep the content up-to-date with the latest articles. If you have any requests or feedback for topics to be included in this ebook or the Active Directory Friday series, please leave a comment below.

Active Directory Friday All Articles
Books
Active Directory Friday
PDF_download Download PDF
EPub_logo Download EPUB
mobi Download MOBI
Share

New article on PowerShell Magazine: Convert .docx to .pdf using Word.Application

ConvertDocxPdf
To convert a docx document to pdf the Word.Application Com Object can be used, for PowerShell Magazine I wrote a tip in which I describe this process. The full article  is available on PowerShell Magazine : Convert .docx to .pdf using Word.Application

1
2
3
$Word = New-Object -ComObject "Word.Application"
($Word.Documents.Open('c:\temp\file.docx')).SaveAs([ref]'c:\temp\file.pdf',[ref]17) 
$Word.Application.ActiveDocument.Close()

For more articles like this, have a look at the External Articles section of my blog, it contains all the articles I have posted on external sources such as PowerShell Magazine.

Links in this Article
PSTip: Convert .docx to .pdf using Word.Application
PowerShell Magazine
External Articles
Share