<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.snowland.se/~d/styles/itemcontent.css"?><rss 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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>snowland.se</title>
	
	<link>http://www.snowland.se</link>
	<description>Rikard Rönnkvist blogging about Microsoft System Center and other management stuff...</description>
	<lastBuildDate>Tue, 25 Jan 2011 09:32:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.snowland.se/snowland" /><feedburner:info uri="snowland" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><thespringbox:skin xmlns:thespringbox="http://www.thespringbox.com/dtds/thespringbox-1.0.dtd">http://feeds.snowland.se/snowland?format=skin</thespringbox:skin><geo:lat>60.602214</geo:lat><geo:long>15.586493</geo:long><item>
		<title>Get ConfigMgr Collection rules</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/m1hwh_PXQxI/</link>
		<comments>http://www.snowland.se/2011/01/25/get-configmgr-collection-rules/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 09:32:57 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[ConfigMgr]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Collections]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Rules]]></category>
		<category><![CDATA[WQL]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=537</guid>
		<description><![CDATA[I&#8217;m in the process of installing Forefront Endpoint Protection and wanted to look at some of the collection queries that was created&#8230; but with the ConfigMgr console you cant view them&#8230; So Powershell it is. Did a function that you can use on any collection (with subcollections) to view the WQL. A small warning: It [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of installing Forefront Endpoint Protection and wanted to look at some of the collection queries that was created&#8230; but with the ConfigMgr console you cant view them&#8230;</p>
<p>So Powershell it is.</p>
<p>Did a function that you can use on any collection (with subcollections) to view the WQL.</p>
<pre class="brush: powershell; title: ; notranslate">
Import-Module SCCM\SCCM-Functions -Force
Function Get-CollectionRules {
	PARAM (
		$parentCollection,
		$spacer,
		$sccm
	)

	$subCollections = Get-SCCMSubCollections -SccmServer $sccm -CollectionID $parentCollection

	if ($subCollections -ne $null) {
		$subCollections | ForEach-Object {
			$collection = Get-SCCMCollection -Filter &quot;CollectionID='$($_.subCollectionID)'&quot; -SccmServer $sccm
			Write-Host &quot;$($spacer) Name: &quot; -ForegroundColor Yellow -NoNewline
			Write-Host &quot;$($collection.CollectionID) - $($collection.Name)&quot;

			$collectionRule = (Get-SCCMCollectionRules -SccmServer ( Connect-SCCMServer ) -CollectionID $collection.CollectionID)
			if ($collectionRule -ne $null) {
				Write-Host &quot;$($spacer)Limit: &quot; -ForegroundColor Yellow -NoNewline
				if ($collectionRule.LimitToCollectionID.Length -gt 0) {
					Write-Host &quot;$($collectionRule.LimitToCollectionID)&quot; -ForegroundColor White
				} else {
					Write-Host &quot;&lt;No limit to collection&gt;&quot; -ForegroundColor Gray
				}

				Write-Host &quot;$($spacer)  WQL: &quot; -ForegroundColor Yellow -NoNewline
				Write-Host &quot;$($collectionRule.QueryExpression)&quot;
			} else {
				Write-Host &quot;$($spacer)&lt;no rule present on collection&gt;&quot; -ForegroundColor Gray
			}
			Write-Host &quot;&quot;

			Get-CollectionRules -parentCollection $_.subCollectionID -spacer &quot;   $($spacer)&quot; -sccm $sccm
		}
	}
}

Get-CollectionRules -parentCollection &quot;XYZ00123&quot; -spacer &quot;&quot; -sccm (Connect-SCCMServer)
</pre>
<p>A small warning: It will loop all of the subcollections, and the subcollections subcollections, and so on&#8230;</p>

<p><a href="http://feedads.g.doubleclick.net/~a/VqFKLmkPuZBRWnMvRUPwgcJJcE4/0/da"><img src="http://feedads.g.doubleclick.net/~a/VqFKLmkPuZBRWnMvRUPwgcJJcE4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VqFKLmkPuZBRWnMvRUPwgcJJcE4/1/da"><img src="http://feedads.g.doubleclick.net/~a/VqFKLmkPuZBRWnMvRUPwgcJJcE4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=m1hwh_PXQxI:8DsyjrYMjKU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=m1hwh_PXQxI:8DsyjrYMjKU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=m1hwh_PXQxI:8DsyjrYMjKU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=m1hwh_PXQxI:8DsyjrYMjKU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=m1hwh_PXQxI:8DsyjrYMjKU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=m1hwh_PXQxI:8DsyjrYMjKU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=m1hwh_PXQxI:8DsyjrYMjKU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/m1hwh_PXQxI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2011/01/25/get-configmgr-collection-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2011/01/25/get-configmgr-collection-rules/</feedburner:origLink></item>
		<item>
		<title>Win7 Themes and Screensaver</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/3W0Wx-3cBWw/</link>
		<comments>http://www.snowland.se/2011/01/11/win7-themes-and-screensaver/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 11:58:20 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[Snowland.se]]></category>
		<category><![CDATA[GPO]]></category>
		<category><![CDATA[GPP]]></category>
		<category><![CDATA[Screensaver]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=530</guid>
		<description><![CDATA[If you want to enforce users to use a specific screensaver you can do most of it via standard group policies. But if you run Windows 7 and a user changes the current theme&#8230; the screensaver will be blank until the next group policy refresh. This is due to that the default .theme-files have no [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to enforce users to use a specific screensaver you can do most of it via standard group policies. But if you run Windows 7 and a user changes the current theme&#8230; the screensaver will be blank until the next group policy refresh.<br />
This is due to that the default .theme-files have no screensaver defined.</p>
<p>With Group Policy Preferences you can change this&#8230;</p>
<p>First we need to change the current ACL on the themes directories since SYSTEM cant write there.</p>
<p>Edit or create a Group Policy.<br />
Browse to <strong>Computer Configuration &#8211; Windows Settings &#8211; Security Settings &#8211; File System</strong><br />
Right Click and select <strong>Add File&#8230;</strong> then write <strong>%SystemRoot%\Resources\Themes</strong> in the Folder-box.<br />
Set the security rights as you want them, but remember to give <strong>SYSTEM</strong> the rights to <strong>Modify</strong>.<br />
In the dialog &#8220;Add Object&#8221; that pops up when you press OK, select <strong>Replace existing permissions on all suboflders and files with inheritable permissions</strong>, this option is not selected as a default.<br />
Repeat that for <strong>%SystemRoot%\Resources\Ease of Access Themes</strong> directory.</p>
<p>Then browse to <strong>Computer Configuration &#8211; Preferences &#8211; Windows Settings &#8211; Ini Files</strong><br />
Right Click and select <strong>New &#8211; Ini File</strong><br />
Give the following options:<br />
<img src="/wp/wp-content/uploads/110111-Screensaver.png" /><br />
(I would recommend that you set a item level targeting to check that the file exist)</p>
<p>Now to the boring part, repeat that for all Theme-files in the directories <strong>%SystemRoot%\Resources\Themes</strong> and <strong>%SystemRoot%\Resources\Ease of Access Themes</strong></p>
<p>If there is something else you want to change you can find loads of options for themes in this reference <a href="http://msdn.microsoft.com/en-us/library/bb773190%28v=vs.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/bb773190%28v=vs.85%29.aspx</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/mfw8hQqdfPQ8vUV4Jc1oQaSkvTM/0/da"><img src="http://feedads.g.doubleclick.net/~a/mfw8hQqdfPQ8vUV4Jc1oQaSkvTM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mfw8hQqdfPQ8vUV4Jc1oQaSkvTM/1/da"><img src="http://feedads.g.doubleclick.net/~a/mfw8hQqdfPQ8vUV4Jc1oQaSkvTM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=3W0Wx-3cBWw:m2X2z3A9iC0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=3W0Wx-3cBWw:m2X2z3A9iC0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=3W0Wx-3cBWw:m2X2z3A9iC0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=3W0Wx-3cBWw:m2X2z3A9iC0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=3W0Wx-3cBWw:m2X2z3A9iC0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=3W0Wx-3cBWw:m2X2z3A9iC0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=3W0Wx-3cBWw:m2X2z3A9iC0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/3W0Wx-3cBWw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2011/01/11/win7-themes-and-screensaver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2011/01/11/win7-themes-and-screensaver/</feedburner:origLink></item>
		<item>
		<title>Bulk import of SNMP devices to OpsMgr</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/kzjKp5MztPA/</link>
		<comments>http://www.snowland.se/2010/11/17/bulk-import-of-snmp-devices-to-opsmgr/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 09:48:41 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[OpsMgr]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Discovery]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[SNMP]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=524</guid>
		<description><![CDATA[If you want to import a larger bunch of SNMP-devices in to OpsMgr you will probably go thru the disovery wizard way to many times. Instead of walking thru that wizard every time I asked the network team to write a CSV-file with all the devices and then used this function to import them. And [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to import a larger bunch of SNMP-devices in to OpsMgr you will probably go thru the disovery wizard way to many times.</p>
<p>Instead of walking thru that wizard every time I asked the network team to write a CSV-file with all the devices and then used this function to import them.</p>
<pre class="brush: powershell; title: ; notranslate">
Function Add-SnmpDevice {
	PARAM (
		[Parameter(Mandatory=$true )][string] $FromIpAddress,
		[Parameter(Mandatory=$true )][string] $MonitoringProxy,
		[string] $ManagementServer,
		[string] $ToIpAddress = &quot;&quot;,
		[string] $SnmpCommunityString = &quot;public&quot;,
		[int32] $SnmpVersion = 2
	)

	# Single ip ?
	If ($ToIpAddress.Length -eq 0) {
		$ToIpAddress = $FromIpAddress
	}

	# Check SNMP version
	if ($SnmpVersion -ne 1 -and $SnmpVersion -ne 2) {
		Throw &quot;Only SNMP version 1 and 2 supported&quot;
	}

	Write-Host &quot;Setting up discovery for SNMP-devices...&quot;
	Write-Host &quot;       From: $($FromIpAddress)&quot;
	Write-Host &quot;         To: $($ToIpAddress)&quot;
	Write-Host &quot;  Community: $($SnmpCommunityString)&quot;
	Write-Host &quot;   SNMP ver: $($SnmpVersion)&quot;

	$networkDeviceClass = Get-MonitoringClass -name &quot;System.NetworkDevice&quot;
	$DeviceDiscoveryConfig = New-DeviceDiscoveryConfiguration -MonitoringClass $networkDeviceClass -FromIpAddress $FromIpAddress -ToIpAddress $ToIpAddress

	# Set Community String
	$encoding = New-Object System.Text.UnicodeEncoding
	$encodedCommunityString = $encoding.GetBytes($SnmpCommunityString)
	$DeviceDiscoveryConfig.ReadOnlyCommunity = [System.Convert]::ToBase64String($encodedCommunityString)

	# Set SNMP version
	$DeviceDiscoveryConfig.SnmpVersion = $SnmpVersion

	# Get management server
	If ($ManagementServer.Length -eq 0) {
		$mgmtServer = Get-RootManagementServer
	} else {
		$mgmtServer = Get-ManagementServer | Where-Object {$_.Name -eq $ManagementServer}
	}
	If ($mgmtServer -eq $null) {
		Throw &quot;Cant find management server named $($ManagementServer)&quot;
	} else {
		Write-Host &quot;Found management server: $($mgmtServer.name)&quot;
	}

	# Find proxy agent
	Write-Host &quot;Lookup of proxy agent named $($MonitoringProxy) ...&quot;
	$ProxyAgent = Get-Agent | Where-Object {$_.Name -eq $MonitoringProxy}
	If ($ProxyAgent -eq $null) {
		Write-Host &quot;No agent named $($MonitoringProxy) found, checking managementservers&quot;
		$ProxyAgent = Get-ManagementServer | Where-Object {$_.Name -eq $MonitoringProxy}
		$ProxyIsMgmtServer = $true
	} else {
		$ProxyIsMgmtServer = $false
	}

	If ($ProxyAgent -eq $null) {
		Throw &quot;Can't find agent or managementserver named $($MonitoringProxy)&quot;
	} else {
		Write-Host &quot;Found $($ProxyAgent.Name)&quot;
	}

	Write-Host &quot;Starting discovery...&quot;
	$DiscResults = Start-Discovery -ManagementServer: $mgmtServer -DeviceDiscoveryConfiguration: $DeviceDiscoveryConfig

	If ($DiscResults.CustomMonitoringObjects.Count -eq 0) {
		Write-Host &quot;Cant discover any objects&quot;
		Return 0
	} else {
		$ObjectCount = 0
		Write-Host &quot;Found objects&quot;
		$discresults | select-object -expandproperty CustomMonitoringObjects | Select-Object Name | Format-Table -HideTableHeaders

		$DiscResults | ForEach-Object {
			Write-Host &quot;Adding object to proxy...&quot;
			if ($ProxyIsMgmtServer -eq $true) {
				$ProxyAgent.InsertRemotelyManagedDevices($_.CustomMonitoringObjects) | Format-Table SnmpDevice, ProxyAgentPrincipalName, ManagementGroup -HideTableHeaders
			} else {
				Add-RemotelyManagedDevice -proxyagent $ProxyAgent -device $_.CustomMonitoringObjects
			}
			$ObjectCount++
		}
		Return $ObjectCount
	}
}
</pre>
<p>And two examples on how you can use it to add some devices:</p>
<pre class="brush: powershell; title: ; notranslate">
# Add a devices in the range 192.168.100.240-.254 with the community &quot;SomeSecret&quot;
# Use mgmtserver.snowland.demo to do the discovery and add the devices with snmpmonitor.snowland.demo as monitoring proxy
Add-SnmpDevice -FromIpAddress &quot;192.168.100.240&quot; -ToIpAddress &quot;192.168.100.254&quot; -SnmpCommunityString &quot;SomeSecret&quot; -ManagementServer &quot;mgmtserver.snowland.demo&quot; -MonitoringProxy &quot;snmpmonitor.snowland.demo&quot;

# Add a single SNMPv1 device with the &quot;public&quot; community, use the RMS to do discovery
Add-SnmpDevice -FromIpAddress &quot;192.168.100.10&quot; -MonitoringProxy &quot;snmpmonitor.snowland.demo&quot; -SnmpVersion 1
</pre>
<p>So we ended up with something like this:</p>
<pre class="brush: powershell; title: ; notranslate">
Import-Csv &quot;.\snmplist.csv&quot; -Delimiter &quot;;&quot; | ForEach-Object {
	Add-SnmpDevice -FromIpAddress $_.IpFrom -ToIpAddress $_.IpTo -SnmpCommunityString $_.Community -ManagementServer $_.MgmtServer -MonitoringProxy $_.Proxy
}
</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/Q08fV6ijpVhDbpMJlRR_frbhCqY/0/da"><img src="http://feedads.g.doubleclick.net/~a/Q08fV6ijpVhDbpMJlRR_frbhCqY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Q08fV6ijpVhDbpMJlRR_frbhCqY/1/da"><img src="http://feedads.g.doubleclick.net/~a/Q08fV6ijpVhDbpMJlRR_frbhCqY/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=kzjKp5MztPA:Q9W1WzzYdm0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=kzjKp5MztPA:Q9W1WzzYdm0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=kzjKp5MztPA:Q9W1WzzYdm0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=kzjKp5MztPA:Q9W1WzzYdm0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=kzjKp5MztPA:Q9W1WzzYdm0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=kzjKp5MztPA:Q9W1WzzYdm0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=kzjKp5MztPA:Q9W1WzzYdm0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/kzjKp5MztPA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/11/17/bulk-import-of-snmp-devices-to-opsmgr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/11/17/bulk-import-of-snmp-devices-to-opsmgr/</feedburner:origLink></item>
		<item>
		<title>InstallShield – No Log</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/-svozdzDkuo/</link>
		<comments>http://www.snowland.se/2010/11/09/installshield-no-log/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 13:38:19 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[ConfigMgr]]></category>
		<category><![CDATA[InstallShiled]]></category>
		<category><![CDATA[Logfile]]></category>
		<category><![CDATA[Paramters]]></category>
		<category><![CDATA[Setup]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=520</guid>
		<description><![CDATA[Ok&#8230; It&#8217;s kind of hard to find any information on how to completely remove the need for a logfile when installing a InstallShield based setup file. You can use: -f2[some\path\to\a\LogFile] To say where you want the logfile to go. But&#8230; If you completely want to silence it use: -f2x It&#8217;s that simple, but it isn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Ok&#8230; It&#8217;s kind of hard to find any information on how to completely remove the need for a logfile when installing a InstallShield based setup file.</p>
<p>You can use:<br />
<strong>-f2[some\path\to\a\LogFile]</strong><br />
To say where you want the logfile to go.</p>
<p>But&#8230; If you completely want to silence it use:<br />
<strong>-f2x</strong></p>
<p>It&#8217;s that simple, but it isn&#8217;t that simple to find the information.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ysHU2RgVwXcJsaXXZCf3sAC4_HA/0/da"><img src="http://feedads.g.doubleclick.net/~a/ysHU2RgVwXcJsaXXZCf3sAC4_HA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ysHU2RgVwXcJsaXXZCf3sAC4_HA/1/da"><img src="http://feedads.g.doubleclick.net/~a/ysHU2RgVwXcJsaXXZCf3sAC4_HA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=-svozdzDkuo:DmSlL1nUAVU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=-svozdzDkuo:DmSlL1nUAVU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=-svozdzDkuo:DmSlL1nUAVU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=-svozdzDkuo:DmSlL1nUAVU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=-svozdzDkuo:DmSlL1nUAVU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=-svozdzDkuo:DmSlL1nUAVU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=-svozdzDkuo:DmSlL1nUAVU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/-svozdzDkuo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/11/09/installshield-no-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/11/09/installshield-no-log/</feedburner:origLink></item>
		<item>
		<title>Change Source-paths in ConfigMgr</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/dWPtGUHH7aA/</link>
		<comments>http://www.snowland.se/2010/10/29/change-source-paths-in-configmgr/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 07:30:50 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[ConfigMgr]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=515</guid>
		<description><![CDATA[I&#8217;m in the process of moving tons of packages to a new source. So&#8230; I did a few new functions to my Powershell Module http://www.snowland.se/sccm-posh/ Oh&#8230; and I found some additional updates posted in German by Stefan Ringler &#8230; I don&#8217;t understand that many words of German, but I can read Powershell. Anyway, I included [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of moving tons of packages to a new source.</p>
<p>So&#8230; I did a few new functions to my Powershell Module <a href="http://www.snowland.se/sccm-posh/">http://www.snowland.se/sccm-posh/</a>  <img src='http://www.snowland.se/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre class="brush: powershell; title: ; notranslate">
Update-SCCMDriverPkgSourcePath -sccmserver (Connect-SCCMServer) -currentPath &quot;\\OLDSERVER\Source\DriverPackages&quot; -newPath &quot;\\NEWSERVER\Source\DriverPackages&quot;
Update-SCCMPackageSourcePath -sccmserver (Connect-SCCMServer) -currentPath &quot;\\OLDSERVER\Source\Packages&quot; -newPath &quot;\\NEWSERVER\Source\Packages&quot;
Update-SCCMDriverSourcePath -sccmserver (Connect-SCCMServer) -currentPath &quot;\\OLDSERVER\Source\DriverImport&quot; -newPath &quot;\\NEWSERVER\Source\DriverImport&quot;
</pre>
<p>Oh&#8230; and I found some additional updates posted in German by <a href="http://www.stefanringler.com/?p=150">Stefan Ringler</a> &#8230; I don&#8217;t understand that many words of German, but I can read Powershell. <img src='http://www.snowland.se/wp/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<p>Anyway, I included the updates in the module&#8230; thanks Stefan for sharing.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/KJzoOnfMUyQyZ9gXGJEwsWnJcHw/0/da"><img src="http://feedads.g.doubleclick.net/~a/KJzoOnfMUyQyZ9gXGJEwsWnJcHw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KJzoOnfMUyQyZ9gXGJEwsWnJcHw/1/da"><img src="http://feedads.g.doubleclick.net/~a/KJzoOnfMUyQyZ9gXGJEwsWnJcHw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=dWPtGUHH7aA:XFrTUFcwP_Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=dWPtGUHH7aA:XFrTUFcwP_Q:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=dWPtGUHH7aA:XFrTUFcwP_Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=dWPtGUHH7aA:XFrTUFcwP_Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=dWPtGUHH7aA:XFrTUFcwP_Q:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=dWPtGUHH7aA:XFrTUFcwP_Q:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=dWPtGUHH7aA:XFrTUFcwP_Q:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/dWPtGUHH7aA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/10/29/change-source-paths-in-configmgr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/10/29/change-source-paths-in-configmgr/</feedburner:origLink></item>
		<item>
		<title>Create GPOs with Powershell</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/OKvYkr8dCuE/</link>
		<comments>http://www.snowland.se/2010/09/17/create-gpos-with-powershell/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 12:20:07 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[GPO]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[AGPM]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=509</guid>
		<description><![CDATA[We are in the process of migrating to a brand spankin new Active Directory &#8230; and since it&#8217;s new there are no GPOs yet. To automate and keep a strict naming convention we will use a self service portal to create GPOs. This portal will have a few dropdown-boxes with options to minimize the risk [...]]]></description>
			<content:encoded><![CDATA[<p>We are in the process of migrating to a brand spankin new Active Directory &#8230; and since it&#8217;s new there are no GPOs yet.</p>
<p>To automate and keep a strict naming convention we will use a self service portal to create GPOs.<br />
This portal will have a few dropdown-boxes with options to minimize the risk of an user not creating the GPO as we want&#8230;</p>
<p>Anyway. This portal will fire a Powershell script that actualy creates the GPO and sets a bunch of things on it.</p>
<p>This script will:</p>
<ul>
<li>Creates an AD-group</li>
<li>Creates an GPO</li>
<li>Remove Authenticated Users from GPO Security Filtering</li>
<li>Add a Administrator-group to the GPO</li>
<li>Adds a group with editing access to the GPO</li>
<li>Add the AD-Group created in the first step to Security Filtering on GPO</li>
<li>Disable Policy Computer/User Settings depending on the GPO scope</li>
<li>Add GPO-link to a Computer- or User-OU</li>
</ul>
<p>Actually our script will give a few other groups and services (Advanced Group Policy Management &#8211; AGPM &#8211; to give one example) access to the GPOs and we create a Test-GPO as well&#8230; but I guess this is a good start for many of you.</p>
<pre class="brush: powershell; title: ; notranslate">
PARAM (
	[string] $gpoScope = &quot;U&quot;,
	[string] $gpoDescription = &quot;PowershellTesting01&quot;,
	[string] $groupPrefix = &quot;MyPrefix_L_&quot;,

	[string] $groupPath = &quot;OU=All Groups,DC=snowland,DC=se&quot;,
	[string] $gpoLinkPathC = &quot;OU=All Computers,DC=snowland,DC=se&quot;,
	[string] $gpoLinkPathU = &quot;OU=All Users,DC=snowland,DC=se&quot;,

	[string] $gpoAdminsitrators = &quot;MyPrefix_L_Role-GPO-Administrators&quot;,
	[string] $gpoEditors = &quot;MyPrefix_L_Role-GPO-Editors&quot;
)

Import-Module GroupPolicy
Import-Module ActiveDirectory

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$gpoName = &quot;GPO-$($gpoScope)-$($gpoDescription)&quot;
$adGroupName = &quot;$($groupPrefix)$($gpoName)&quot;
$domainName = (Get-ADDomain).NetBIOSName
$dcServer = (Get-ADDomaincontroller).HostName

Write-Host &quot;Settings:&quot; -ForegroundColor Cyan
Write-Host &quot;   AD GroupName       : $($adGroupName)&quot; -ForegroundColor Cyan
Write-Host &quot;   GPO Name           : $($gpoName)&quot; -ForegroundColor Cyan
Write-Host &quot;   GPO Prod           : $($gpoNameProd)&quot; -ForegroundColor Cyan
Write-Host &quot;   GPO Scope          : $($gpoScope)&quot; -ForegroundColor Cyan
Write-Host &quot;   Domain Controller  : $($dcServer)&quot; -ForegroundColor Cyan
Write-Host &quot;   Domain Name        : $($domainName)&quot; -ForegroundColor Cyan
Write-Host &quot;&quot; -ForegroundColor Cyan

Write-Host &quot;AD: Create AD group -&quot; -ForegroundColor Cyan
New-ADGroup -Name $adGroupName -Description &quot;GPO $($gpoScope) $($gpoDescription)&quot; -GroupScope DomainLocal -Path $groupPath -Server $dcServer

Write-Host &quot;Policy: Create policy&quot; -ForegroundColor Cyan
New-GPO -Name $gpoName -Comment &quot;$($gpoScope) $($gpoDescription)&quot; -Server $dcServer

Write-Host &quot;10 second pause to give AD a chanse to catch up&quot; -ForegroundColor Cyan
Start-Sleep -Seconds 10

Write-Host &quot;Remove Authenticated Users from GPO Security Filtering&quot; -ForegroundColor Cyan
Set-GPPermissions -Name $gpoName -PermissionLevel None -TargetName &quot;Authenticated Users&quot; -TargetType Group -Server $dcServer

Write-Host &quot;Add Administrators to GPO&quot; -ForegroundColor Cyan
Set-GPPermissions -Name $gpoName -PermissionLevel GpoEditDeleteModifySecurity -TargetName $gpoAdminsitrators -TargetType group -Server $dcServer

Write-Host &quot;Add Editors to GPO&quot; -ForegroundColor Cyan
Set-GPPermissions -Name $gpoName -PermissionLevel GpoEdit -TargetName $gpoEditors -TargetType group -Server $dcServer

Write-Host &quot;Add AD-Group to Security Filtering on GPO&quot; -ForegroundColor Cyan
Set-GPPermissions -Name $gpoName -PermissionLevel GpoApply -TargetName &quot;$($adGroupName)&quot; -TargetType Group -Server $dcServer

If ($gpoScope -eq &quot;C&quot;) {
	Write-Host &quot;Disable Policy User Settings&quot; -ForegroundColor Cyan
	(Get-GPO -Name $gpoName -Server $dcServer).GpoStatus = &quot;UserSettingsDisabled&quot;

	Write-Host &quot;Add GPO-link to Computer OU&quot; -ForegroundColor Cyan
	New-GPLink -Name $gpoName -Target $gpoLinkPathC -LinkEnabled Yes -Server $dcServer
} else {
	Write-Host &quot;Disable Policy Computer Settings&quot; -ForegroundColor Cyan
	(Get-GPO -Name $gpoName -Server $dcServer).GpoStatus = &quot;ComputerSettingsDisabled&quot;

	Write-Host &quot;Add GPO-link to User OU&quot; -ForegroundColor Cyan
	New-GPLink -Name $gpoName -Target $gpoLinkPathU -LinkEnabled Yes -Server $dcServer
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Write-Host &quot;&quot; -ForegroundColor Cyan
Write-Host &quot;Done!&quot; -ForegroundColor Cyan
</pre>
<p>Now I only need to figure out how to get AGPM to take control of the GPO &#8230;</p>

<p><a href="http://feedads.g.doubleclick.net/~a/JbICAt24sBktaKWHXD_SIHn2f_E/0/da"><img src="http://feedads.g.doubleclick.net/~a/JbICAt24sBktaKWHXD_SIHn2f_E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JbICAt24sBktaKWHXD_SIHn2f_E/1/da"><img src="http://feedads.g.doubleclick.net/~a/JbICAt24sBktaKWHXD_SIHn2f_E/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=OKvYkr8dCuE:54rFmGm-Zt8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=OKvYkr8dCuE:54rFmGm-Zt8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=OKvYkr8dCuE:54rFmGm-Zt8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=OKvYkr8dCuE:54rFmGm-Zt8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=OKvYkr8dCuE:54rFmGm-Zt8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=OKvYkr8dCuE:54rFmGm-Zt8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=OKvYkr8dCuE:54rFmGm-Zt8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/OKvYkr8dCuE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/09/17/create-gpos-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/09/17/create-gpos-with-powershell/</feedburner:origLink></item>
		<item>
		<title>Maintenance Mode via Powershell Remoting</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/A2JWAvc0294/</link>
		<comments>http://www.snowland.se/2010/08/23/maintenance-mode-via-powerhsell-remoting/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 11:19:46 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[OpsMgr]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Maintenance Mode]]></category>
		<category><![CDATA[Remoting]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=502</guid>
		<description><![CDATA[There are loads of scripts and GUIs that you can use to set Maintenance Mode in OpsMgr, but if you want to do this from a server that doesn&#8217;t have the OpsMgr-snapins for Powershell it&#8217;s a bit harder&#8230; But then there is Powershell v2 and Remoting&#8230; It gives you the option to run a scriptblock [...]]]></description>
			<content:encoded><![CDATA[<p>There are loads of scripts and GUIs that you can use to set Maintenance Mode in OpsMgr, but if you want to do this from a server that doesn&#8217;t have the OpsMgr-snapins for Powershell it&#8217;s a bit harder&#8230;</p>
<p>But then there is Powershell v2 and Remoting&#8230; It gives you the option to run a  scriptblock on another computer&#8230;</p>
<p>Just enable remoting on your RMS and then try this script from another machine:</p>
<pre class="brush: powershell; title: ; notranslate">
Function setMaintMode {
	PARAM (
		[string] $rmsHostname,
		[string] $agentName,
		[string] $Comment,
		[string] $Reason,
		[int] $Time
	)

	Invoke-Command -ComputerName $rmsHostname -scriptblock {
		PARAM (
			[string] $agentName,
			[string] $Comment,
			[string] $Reason,
			[int] $Time
		)

		Add-PSSnapin &quot;Microsoft.EnterpriseManagement.OperationsManager.Client&quot;
		Set-Location &quot;OperationsManagerMonitoring::&quot;
		New-ManagementGroupConnection -ConnectionString:localhost | Out-Null

		$computerClass = Get-MonitoringClass -name:Microsoft.Windows.Computer
		$computerCriteria = &quot;PrincipalName='&quot; + $agentName + &quot;'&quot;
		$computer = get-monitoringobject -monitoringclass:$computerClass -criteria:$computerCriteria

		if ($computer.InMaintenanceMode -eq $false) {
			$startTime = [System.DateTime]::Now
			$endTime = $startTime.AddMinutes($Time)

			New-MaintenanceWindow -startTime $startTime -endTime $endTime -Comment $comment -Reason $Reason -monitoringObject $computer
			return $true
		}  else {
			# Allready in maintenance mode
			return $false
		}

	} -ArgumentList $agentName, $Comment, $Reason, $Time
}

setMaintMode -rmsHostname &quot;rmsserver.domain.local&quot; -agentName &quot;currentserver.domain.local&quot; -Comment &quot;Some comment&quot; -Time 30 -Reason &quot;PlannedOperatingSystemReconfiguration&quot;
</pre>
<p>What it does is that it run&#8217;s the OpsMgr-specific parts on the RMS instead on your local machine&#8230; so with that in place it&#8217;s easy to create a GUI around it and then spread a shortcut to all your servers that have Powershell v2 installed.</p>
<p><strong>Notes:</strong><br />
The quick and dirty way to enable remoting on your rms, start cmd as an administrator and run <strong>winrm quickconfig</strong><br />
<a href="http://blogs.msdn.com/b/powershell/archive/2008/05/10/remoting-with-powershell-quickstart.aspx">Here</a> can you find a quick intro to PS Remoting.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/kSd0_qctXR1LhY3P_a9Y1Ne8VeI/0/da"><img src="http://feedads.g.doubleclick.net/~a/kSd0_qctXR1LhY3P_a9Y1Ne8VeI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kSd0_qctXR1LhY3P_a9Y1Ne8VeI/1/da"><img src="http://feedads.g.doubleclick.net/~a/kSd0_qctXR1LhY3P_a9Y1Ne8VeI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=A2JWAvc0294:GQzHu5YkCgQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=A2JWAvc0294:GQzHu5YkCgQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=A2JWAvc0294:GQzHu5YkCgQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=A2JWAvc0294:GQzHu5YkCgQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=A2JWAvc0294:GQzHu5YkCgQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=A2JWAvc0294:GQzHu5YkCgQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=A2JWAvc0294:GQzHu5YkCgQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/A2JWAvc0294" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/08/23/maintenance-mode-via-powerhsell-remoting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/08/23/maintenance-mode-via-powerhsell-remoting/</feedburner:origLink></item>
		<item>
		<title>ConfigMrg Native Mode and site signing certificate</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/RHcov8Fsd7k/</link>
		<comments>http://www.snowland.se/2010/07/09/configmrg-native-mode-and-site-signing-certificate/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 08:48:38 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[ConfigMgr]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[CertReq]]></category>
		<category><![CDATA[Native Move]]></category>
		<category><![CDATA[SMS_POLICY_PROVIDER]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=496</guid>
		<description><![CDATA[After trying to switch to native mode in ConfigMgr we got some errors from SMS_POLICY_PROVIDER saying &#8220;SMS Policy Provider has failed to sign one or more policy assignments. It will retry this operation automatically.&#8221; Strange since we did follow a (this one) step-by-step guide from Microsoft. After a few searches on Google and TechNet I [...]]]></description>
			<content:encoded><![CDATA[<p>After trying to switch to native mode in ConfigMgr we got some errors from SMS_POLICY_PROVIDER saying &#8220;SMS Policy Provider has failed to sign one or more policy assignments. It will retry this operation automatically.&#8221;</p>
<p>Strange since we did follow a (<a href="http://technet.microsoft.com/en-us/library/cc872789.aspx">this one</a>) step-by-step guide from Microsoft.</p>
<p>After a few searches on Google and TechNet I found out that I needed to add a few lines in the request-file&#8230; FriendlyName and KeyLength&#8230;</p>
<pre class="brush: plain; title: ; notranslate">
[NewRequest]
FriendlyName = &quot;ConfigMgr Site Signing ABC&quot;
Subject = &quot;CN=The site code of this site server is ABC&quot;
MachineKeySet = True
KeyLength = 2048

[RequestAttributes]
CertificateTemplate = ConfigMgrSiteServerSigningCertificate
</pre>
<p>Then I requested a new cert with that file and used the new certificate instead&#8230; and a few minutes later SMS_POLICY_PROVIDER says &#8220;SMS Policy Provider successfully updated a settings policy and a settings policy assignment.&#8221;</p>
<p> <img src='http://www.snowland.se/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p><a href="http://feedads.g.doubleclick.net/~a/rK0jxfuF1pZjOysWYmQNqsmyJ4I/0/da"><img src="http://feedads.g.doubleclick.net/~a/rK0jxfuF1pZjOysWYmQNqsmyJ4I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rK0jxfuF1pZjOysWYmQNqsmyJ4I/1/da"><img src="http://feedads.g.doubleclick.net/~a/rK0jxfuF1pZjOysWYmQNqsmyJ4I/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=RHcov8Fsd7k:T2g-YQNeP6U:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=RHcov8Fsd7k:T2g-YQNeP6U:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=RHcov8Fsd7k:T2g-YQNeP6U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=RHcov8Fsd7k:T2g-YQNeP6U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=RHcov8Fsd7k:T2g-YQNeP6U:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=RHcov8Fsd7k:T2g-YQNeP6U:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=RHcov8Fsd7k:T2g-YQNeP6U:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/RHcov8Fsd7k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/07/09/configmrg-native-mode-and-site-signing-certificate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/07/09/configmrg-native-mode-and-site-signing-certificate/</feedburner:origLink></item>
		<item>
		<title>Change a folder LastWriteTime based on files within it</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/3OVTzPj8rsU/</link>
		<comments>http://www.snowland.se/2010/06/21/change-a-folder-lastwritetime-based-on-files-within-it/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 13:42:37 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[Folders]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[LastWriteTime]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=492</guid>
		<description><![CDATA[A few days ago I wrote a script that copies some files. Did notice that everything except the date on the folders were ok. So I added a few more lines of powershell code. Did find a few suggestions on the web, but I like this one&#8230;. Since I wrote it.]]></description>
			<content:encoded><![CDATA[<p>A few days ago I wrote a script that copies some files. Did notice that everything except the date on the folders were ok. So I added a few more lines of powershell code.</p>
<p>Did find a few suggestions on the web, but I like this one&#8230;. Since I wrote it. <img src='http://www.snowland.se/wp/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<pre class="brush: powershell; title: ; notranslate">
Function Set-FolderDate {
	Param (
		[string] $Path
	)
	Trap  [Exception] {
		Write-Debug $(&quot;TRAPPED: &quot; + $_.Exception.Message);
		Write-Verbose &quot;Could not change date on folder (Folder open in explorer?)&quot;
		Continue
	}

	# Get latest filedate in folder
	$LatestFile = Get-ChildItem $Path | Sort-Object LastWriteTime -Descending | Select-Object -First 1

	# Change the date, if needed
	$Folder = Get-Item $path
	if ($LatestFile.LastWriteTime -ne $Folder.LastWriteTime) {
		Write-Verbose &quot;Changing date on folder '$($Path)' to '$($LatestFile.LastWriteTime)' taken from '$($LatestFile)'&quot;
		$Folder.LastWriteTime = $LatestFile.LastWriteTime
	}

	Return $Folder
}

Set-FolderDate -Path &quot;D:\temp&quot;
</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/W0r8QtdonNxfnLC8K3CHATMLuGE/0/da"><img src="http://feedads.g.doubleclick.net/~a/W0r8QtdonNxfnLC8K3CHATMLuGE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/W0r8QtdonNxfnLC8K3CHATMLuGE/1/da"><img src="http://feedads.g.doubleclick.net/~a/W0r8QtdonNxfnLC8K3CHATMLuGE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=3OVTzPj8rsU:IZX1VG2EkIU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=3OVTzPj8rsU:IZX1VG2EkIU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=3OVTzPj8rsU:IZX1VG2EkIU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=3OVTzPj8rsU:IZX1VG2EkIU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=3OVTzPj8rsU:IZX1VG2EkIU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=3OVTzPj8rsU:IZX1VG2EkIU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=3OVTzPj8rsU:IZX1VG2EkIU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/3OVTzPj8rsU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/06/21/change-a-folder-lastwritetime-based-on-files-within-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/06/21/change-a-folder-lastwritetime-based-on-files-within-it/</feedburner:origLink></item>
		<item>
		<title>Unzip multiple files via Powershell</title>
		<link>http://feeds.snowland.se/~r/snowland/~3/vclgPYjawhc/</link>
		<comments>http://www.snowland.se/2010/06/01/unzip-multiple-files-via-powershell/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 11:41:06 +0000</pubDate>
		<dc:creator>riro</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[Progressbar]]></category>
		<category><![CDATA[Unzip]]></category>
		<category><![CDATA[Zip]]></category>

		<guid isPermaLink="false">http://www.snowland.se/?p=488</guid>
		<description><![CDATA[Simple and effective. Btw&#8230; Watch out&#8230; there is a -Recurse on gci&#8230;]]></description>
			<content:encoded><![CDATA[<p>Simple and effective.</p>
<pre class="brush: powershell; title: ; notranslate">
PARAM (
	[string] $ZipFilesPath = &quot;X:\Somepath\Full\Of\Zipfiles&quot;,
	[string] $UnzipPath = &quot;X:\Somepath\to\extract\to&quot;
)

$Shell = New-Object -com Shell.Application
$Location = $Shell.NameSpace($UnzipPath)

$ZipFiles = Get-Childitem $ZipFilesPath -Recurse -Include *.ZIP

$progress = 1
foreach ($ZipFile in $ZipFiles) {
	Write-Progress -Activity &quot;Unzipping to $($UnzipPath)&quot; -PercentComplete (($progress / ($ZipFiles.Count + 1)) * 100) -CurrentOperation $ZipFile.FullName -Status &quot;File $($Progress) of $($ZipFiles.Count)&quot;
	$ZipFolder = $Shell.NameSpace($ZipFile.fullname)

	$Location.Copyhere($ZipFolder.items(), 1040) # 1040 - No msgboxes to the user - http://msdn.microsoft.com/en-us/library/bb787866%28VS.85%29.aspx
	$progress++
}
</pre>
<p>Btw&#8230; Watch out&#8230; there is a <strong>-Recurse</strong> on gci&#8230; <img src='http://www.snowland.se/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p><a href="http://feedads.g.doubleclick.net/~a/v9kd2xpGGtCq87Qv_hvQz0_9wo4/0/da"><img src="http://feedads.g.doubleclick.net/~a/v9kd2xpGGtCq87Qv_hvQz0_9wo4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/v9kd2xpGGtCq87Qv_hvQz0_9wo4/1/da"><img src="http://feedads.g.doubleclick.net/~a/v9kd2xpGGtCq87Qv_hvQz0_9wo4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.snowland.se/~ff/snowland?a=vclgPYjawhc:EgmQJcsZ_LU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/snowland?i=vclgPYjawhc:EgmQJcsZ_LU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=vclgPYjawhc:EgmQJcsZ_LU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/snowland?i=vclgPYjawhc:EgmQJcsZ_LU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=vclgPYjawhc:EgmQJcsZ_LU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/snowland?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.snowland.se/~ff/snowland?a=vclgPYjawhc:EgmQJcsZ_LU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/snowland?i=vclgPYjawhc:EgmQJcsZ_LU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/snowland/~4/vclgPYjawhc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.snowland.se/2010/06/01/unzip-multiple-files-via-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.snowland.se/2010/06/01/unzip-multiple-files-via-powershell/</feedburner:origLink></item>
	</channel>
</rss>

