<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PowerShell.nu &#187; Client Management</title>
	<atom:link href="http://www.powershell.nu/tag/client-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershell.nu</link>
	<description></description>
	<lastBuildDate>Wed, 14 Jul 2010 22:17:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Managing Local Groups through PowerShell</title>
		<link>http://www.powershell.nu/2009/07/06/managing-local-groups-through-powershell/</link>
		<comments>http://www.powershell.nu/2009/07/06/managing-local-groups-through-powershell/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 14:46:26 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[Client Management]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=781</guid>
		<description><![CDATA[When managing Local Groups through PowerShell, we can use the [ADSI] type adapter. Starting off, We have to connect to the Local Group that we want to modify. PS > $ComputerName = $env:COMPUTERNAME PS > $Group = "Administrators" PS > $LocalGroup = [adsi]"WinNT://$computerName/$Group,group" PS > $LocalGroup distinguishedName : Path : WinNT://Computer01/Administrators,group Now that we&#8217;re connected [...]]]></description>
			<content:encoded><![CDATA[<p>When managing Local Groups through PowerShell, we can use the [ADSI] type adapter.<br />
Starting off, We have to connect to the Local Group that we want to modify.</p>
<p />
<pre>
<strong>
PS > $ComputerName = $env:COMPUTERNAME
PS > $Group = "Administrators"
PS > $LocalGroup = [adsi]"WinNT://$computerName/$Group,group"
PS > $LocalGroup
</strong>

distinguishedName :
Path              : WinNT://Computer01/Administrators,group
</pre>
<p />
Now that we&#8217;re connected to the Local Group, we can start of by adding a user. First let&#8217;s add a Local User.</p>
<p />
<pre>
<strong>
PS > $Domain = "powershell"
PS > $UserName = "nigo"
PS > $LocalGroup.Add("WinNT://$Domain/$userName")
</strong>
</pre>
<p />
This adds the Domain user powershell\nigo to the local Administrators Group. If we instead want to add a Local User, we just replace the Domain Name with the Local COmputer Name.</p>
<p />
<pre>
<strong>
PS > $ComputerName = $env:COMPUTERNAME
PS > $LocalGroup.Add("WinNT://$ComputerName/$userName")
</strong>
</pre>
<p />
And if we want to remove a User from a local Group, we use the Remove() method.</p>
<p />
<pre>
<strong>
PS > $Domain = "powershell"
PS > $UserName = "nigo"
PS > $LocalGroup.Remove("WinNT://$Domain/$userName")
</strong>
</pre>
<p />
Here&#8217;s a script that automates these tasks.</p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2009/07/set-localgroup.ps1">Click here to download the script.</a></p>
<p />
Here are some examples on running the script.</p>
<p />
<pre>
<strong>
PS > Set-LocalGroup.ps1 -UserName nigo -Add

PS > Set-LocalGroup.ps1 -UserName nigo -Remove

PS > Set-LocalGroup.ps1 -UserName nigo -Group "Guests" -Domain powershell -Add

PS > Set-LocalGroup.ps1 -help
</strong>
</pre>
<p />
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/07/06/managing-local-groups-through-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Local Accounts through PowerShell</title>
		<link>http://www.powershell.nu/2009/07/06/managing-local-accounts-through-powershell/</link>
		<comments>http://www.powershell.nu/2009/07/06/managing-local-accounts-through-powershell/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 13:27:07 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[Client Management]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=775</guid>
		<description><![CDATA[When managing Local Accounts through PowerShell, it&#8217;s possible to use the [ADSI] type adapter. Starting off, let&#8217;s look at how to connect to the Local Computer. PS > $ComputerName = $env:COMPUTERNAME PS > $Computer = [adsi]"WinNT://$ComputerName" PS > $Computer distinguishedName : Path : WinNT://Computer01 Now that we have a variable holding the reference to our [...]]]></description>
			<content:encoded><![CDATA[<p>When managing Local Accounts through PowerShell, it&#8217;s possible to use the [ADSI] type adapter.<br />
Starting off, let&#8217;s look at how to connect to the Local Computer.</p>
<p />
<pre>
<strong>
PS > $ComputerName = $env:COMPUTERNAME
PS > $Computer = [adsi]"WinNT://$ComputerName"
PS > $Computer
</strong>

distinguishedName :
Path              : WinNT://Computer01
</pre>
<p />
Now that we have a variable holding the reference to our local computer, we can go ahead and add a Local User Account. This is done through the Create Method on the object. we&#8217;ll also add a Password for our User.</p>
<p />
<pre>
<strong>
PS > $UserName = "NewUser"
PS > $Password = "Password1"
PS > $User = $Computer.Create("user",$UserName)
PS > $User.SetPassword($Password)
PS > $User.SetInfo()
</strong>
</pre>
<p />
And it&#8217;s as simple as that. If you&#8217;r running Windows 7 you have to start PowerShell with elevated rights in order to get it to work.</p>
<p />
Removing the User is done by using the Delete() method.</p>
<p />
<pre>
<strong>
PS > $Computer.Delete("user",$UserName)
</strong>
</pre>
<p />
Here&#8217;s a script i wrote that adds, removes or resets the password of a local User Account.</p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2009/07/set-localaccount.ps1">Click here to download the script</a></p>
<p />
Examples on running the Script:</p>
<p />
<pre>
<strong>
PS > Set-LocalAccount.ps1 -UserName NewUser -Password Password1 -Add
PS > Set-LocalAccount.ps1 -UserName NewUser -Password Password2 -ResetPassword
PS > Set-LocalAccount.ps1 -UserName NewUser -Remove
</strong>
</pre>
<p />
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/07/06/managing-local-accounts-through-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get-PrinterInformation</title>
		<link>http://www.powershell.nu/2009/06/18/get-printerinformation/</link>
		<comments>http://www.powershell.nu/2009/06/18/get-printerinformation/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:41:04 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[Client Management]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=762</guid>
		<description><![CDATA[Gathering Printerinformation can be done through WMI. Win32_Printer contains information about printers that are used by a computer and Win32_PrinterDriver contains information about the printer drivers. We can combine these 2 WMI classes and retrieve information about both the printer and it&#8217;s drivers. This script checks for the following properties: Computer : Client1 Name : [...]]]></description>
			<content:encoded><![CDATA[<p>Gathering Printerinformation can be done through WMI. Win32_Printer contains information about printers that are used by a computer and Win32_PrinterDriver contains information about the printer drivers. We can combine these 2 WMI classes and retrieve information about both the printer and it&#8217;s drivers. This script checks for the following properties:</p>
<p />
<pre>
Computer             : Client1
Name                 : \\SERVER\SRV-FLOOR1-SV01
DefaultPrinter       : True
DriverName           : HP LaserJet 4250 PCL 6
DriverPath           : C:\Windows\system32\spo...
Driverdll            : UNIDRV.DLL
HorizontalResolution : 600
VerticalResolution   : 600
LocalPrinter         : False
PrintProcessor       : HPZPP4wm
Location             : GOT
Comment              : Company Printer
Description          : Printer on Floor 1
</pre>
<p>I&#8217;ve included a switch that let&#8217;s you pipe the information to a csv instead of displaying it to the host, and if you pipe an array of computer names to the script you can retrieve information from multiple computers.</p>
<p />
Running the Script:</p>
<p />
<pre>
<strong>
PS > .\Get-PrinterInformation.ps1 -Computer Client1 -ToCsv

PS > "Client1","Client2","Client3" |
>> ForEach { .\Get-PrinterInformation.ps1 -Computer $_ }
</strong>
</pre>
<p />
Here&#8217;s a link to the script.<br />
<a href="http://www.powershell.nu/wp-content/uploads/2009/06/get-printerinformation.ps1">Get-PrinterInformation.ps1</a></p>
<p />
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/06/18/get-printerinformation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set Folder Permissions using a PowerShell script</title>
		<link>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/</link>
		<comments>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 13:15:45 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[Client Management]]></category>
		<category><![CDATA[ACL]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=430</guid>
		<description><![CDATA[A common Admin task is Setting permissions on folders for new Users or Groups. doing this manually can be pretty boring and timeconsuming. This script automates these steps through PowerShell. The parameters that I&#8217;ve added to the script are: -Path Folder to Create (Required) -User User who should have access (Required) -Permission Specify Permission for [...]]]></description>
			<content:encoded><![CDATA[<p>A common Admin task is Setting permissions on folders for new Users or Groups. doing this manually can be pretty boring and timeconsuming. This script automates these steps through PowerShell.</p>
<p />
The parameters that I&#8217;ve added to the script are:</p>
<p />
<ul>
<li><strong>-Path</strong> Folder to Create (Required)</li>
<li><strong>-User</strong> User who should have access (Required)</li>
<li><strong>-Permission</strong> Specify Permission for User, Default set to Modify (Optional)</li>
<li><strong>-help	</strong> Prints the HelpFile (Optional)</li>
</ul>
<p>The script sets the folderpermissions for a User or a group on a folder and if the folder doesn&#8217;t exist, it creates the folder and adds the specified permissions.</p>
<p />
Running the Script on one folder gives the user or group permissions on the folder and on child folders. If you run the script recurse, it will break the inheritance for the specified User/Group and set the permissions specified on each folder.</p>
<p />
Here are 2 examples on running the script.</p>
<pre>
<strong>
./SetFolderPermission.ps1 -path C:\User -Access APA\MyGroup -Permission Write

Get-ChildItem -path C:\User -recurse |
Where { $_.Attributes -match "d"} |
ForEach {
./SetFolderPermission.ps1 -path $_.Fullname -Access APA\MyGroup -Permission Read
}
</strong>
</pre>
<p />
If you want to display the HelpText simply type:</p>
<p />
<pre>
<strong>
./SetFolderPermission.ps1 -help
</strong>
</pre>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2009/02/setfolderpermission.ps1">Here&#8217;s a link to the script</a></p>
<p />
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Client Inventory through PowerShell</title>
		<link>http://www.powershell.nu/2009/02/05/client-inventory-through-powershell/</link>
		<comments>http://www.powershell.nu/2009/02/05/client-inventory-through-powershell/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 20:23:24 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[Client Management]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=409</guid>
		<description><![CDATA[There are numerous ways of doing a Client Inventory in the Windows environment. You can use various Microsoft technologies to accomplish this, you can collect information stored in the registry or you can retrieve information through WMI. In this post, I&#8217;m going to show how to do this through WMI and PowerShell. WMI is a [...]]]></description>
			<content:encoded><![CDATA[<p>There are numerous ways of doing a Client Inventory in the Windows environment. You can use various Microsoft technologies to accomplish this, you can collect information stored in the registry or you can retrieve information through WMI.</p>
<p />
In this post, I&#8217;m going to show how to do this through WMI and PowerShell. WMI is a versatile extension to the Windows Driver Model that provides an OS interface which components can provide information through. Both PowerShell and Vbs can retrieve information from WMI in a flexible way.</p>
<p />
Starting off, lets look at information from the OperatingSystem, this can be retrieved through the Win32_OperatingSystem class.</p>
<p />
<pre>
<strong>
PS > Get-WmiObject Win32_OperatingSystem
</strong>

SystemDirectory : C:\Windows\system32
Organization    :
BuildNumber     : 7000
RegisteredUser  : nigo
SerialNumber    : 00447-321-7001114-70264
Version         : 6.1.7000
</pre>
<p />
To get even more information we can pipe it to <strong>Format-List *</strong>,which displays all information retrieved.</p>
<p />
I&#8217;ve put togheter a Script that retrieves Client Information from your computer or a remote computer and returns the information in a PsObject. If you are running the script on Remote clients, make sure that the Firewall allows remote administration, otherwise the script won&#8217;t work.</p>
<p />
The Network Inventory in this script only takes the first NetworkAdapter found and retrieves the information. if you have multiple NetworkAdapters you have to modify the script.</p>
<p />
<pre>
<strong>
PS > .\Get-Inventory.ps1 .
</strong>
Gathering Client Information From: .

UserName             : GOT-ZIP-NIGO\nigo
ComputerName         : GOT-ZIP-NIGO
ScreenModel          : NVIDIA Quadro FX 570M (Prerelease - WDDM 1.1)
ChassisType          : Notebook
ComputerManufacturer : Hewlett-Packard
ComputerModel        : HP Compaq 8510w
SerialNumber         : 00447-321-7001114-70264
RAM                  : 3054 MB
CPU                  : Intel(R) Core(TM)2 Duo CPU T7700  @ 2.40GHz
HDDTotal             : 114471 MB
HDDFreeSpace         : 78976 MB
OperatingSystem      : Microsoft Windows 7 Ultimate
Language             : 1033
Domain               : WORKGROUP
IPAdress             : 192.168.0.195
SubNet               : 255.255.255.0
MACAddress           : 00:76:E4:EE:49:00
</pre>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2009/02/get-inventory.ps1">Click Here to download the script.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2009/02/05/client-inventory-through-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
