Chapter 24. Enterprise Computer Management
24.0. Introduction
When working with Windows systems across an enterprise, the question often arises: "How do I do <some task>
in PowerShell?" In an administrator’s perfect world, anybody who designs a feature with management implications also supports (via PowerShell cmdlets) the tasks that manage that feature. Many management tasks have been around longer than PowerShell, though, so the answer can sometimes be, "The same way you did it before PowerShell.”
That’s not to say that your life as an administrator doesn’t improve with the introduction of PowerShell, however. Pre-PowerShell administration tasks generally fall into one of several models: command-line utilities, Windows Management Instrumentation (WMI) interaction, registry manipulation, file manipulation, interaction with COM objects, or interaction with .NET objects.
PowerShell makes it easier to interact with all these task models, and therefore makes it easier to manage functionality that depends on them.
24.1. Program: List Logon or Logoff Scripts for a User
The Group Policy system in Windows stores logon and logoff scripts under the registry keys HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\
and <User SID>
\Scripts\LogonHKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\
<User SID>
\Scripts\Logoff
. Each key has a subkey for each group policy object that applies. Each of those child keys has another level of keys that correspond to individual ...
Get Windows PowerShell Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.