<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Module on sigtar.com</title>
		<link>https://sigtar.com/tags/module/</link>
		<description>Recent content in Module on sigtar.com</description>
		<generator>Hugo</generator>
		<language>en-nz</language>
		
		
		
		
			<lastBuildDate>Thu, 11 Jul 2013 00:00:00 +1200</lastBuildDate>
		
			<atom:link href="https://sigtar.com/tags/module/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>powershell - move machine types to certain OUs in active directory</title>
				<link>https://sigtar.com/2013/07/11/powershell-move-machine-types-to-certain-ous-in-active-directory/</link>
				<pubDate>Thu, 11 Jul 2013 00:00:00 +1200</pubDate>
				<guid>https://sigtar.com/2013/07/11/powershell-move-machine-types-to-certain-ous-in-active-directory/</guid>
				<description>&lt;p&gt;&lt;code&gt;-------------- select additional parameters ----------------------&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Get-ADComputer -Filter * -Properties ipv4Address, OperatingSystem, OperatingSystemServicePack | Format-table name, ipv4*, operatingsystem&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;-------------- move script -----------------&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[cmdletbinding()]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;param ( [parameter(mandatory=$true)] $TargetOU )&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Import-Module ActiveDirectory $Domain = [ADSI]&amp;quot;&amp;quot; $DN=$domain.distinguishedName $SourcePath = &amp;quot;CN=Computers,&amp;quot; + $DN $Computers = Get-ADComputer -Filter * -SearchBase $SourcePath if(!$Computers) { write-host &amp;quot;No Computers are found in default container&amp;quot; return } foreach ($Computer in $Computers) { if(!(Move-ADObject $Computer -TargetPath $TargetOU)) { $Status = &amp;quot;SUCCESS&amp;quot; } else { $Status = &amp;quot;FAILED&amp;quot; } $OutputObj = New-Object -TypeName PSobject $OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Computer.Name.tostring() $OutputObj | Add-Member -MemberType NoteProperty -Name SourcePath -Value $SourcePath $OutputObj | Add-Member -MemberType NoteProperty -Name DestinationPath -Value $TargetOU $OutputObj | Add-Member -MemberType NoteProperty -Name Status -Value $Status $OutputObj }&lt;/code&gt;&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
