<?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>heineborn</title>
	<atom:link href="http://heineborn.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://heineborn.com</link>
	<description></description>
	<lastBuildDate>Mon, 13 May 2013 07:03:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Resetting Password for Specific OU</title>
		<link>http://heineborn.com/tech/resetting-password-for-specific-ou/</link>
		<comments>http://heineborn.com/tech/resetting-password-for-specific-ou/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 08:01:37 +0000</pubDate>
		<dc:creator>Joakim</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://heineborn.com/?p=1530</guid>
		<description><![CDATA[I created a powershell-script which will reset the password of all users in a specific Organizational Unit.

I prefer to set unique high-end passwords for all users. If you prefer a more 'user friendly' approach simply...]]></description>
				<content:encoded><![CDATA[<p>I created a powershell-script which will reset the password of all users in a specific OU.<br />
I prefer to set unique high-end passwords for all users. If you prefer a more &#8216;user friendly&#8217; approach simply remove the &#8220;Function&#8221; and set the $Password variable to something else.<br />
Let me know if you need any help adjusting it.</p>
<pre>
#	Reset Password for a OU - heineborn.com 2013-04-19
#

Import-Module ActiveDirectory

$OU = "ou=OfficeA,dc=HEINEBORN,dc=LOCAL"
$DC = "DC01.HEINEBORN.LOCAL" #Domain Controller

Function Get-RandomPassword {
    $length = 8
    $characters = 'abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ'
    $nonchar = '123456789!$%&#038;?#'
    $random = 1..$length | ForEach-Object { Get-Random -Maximum $characters.length }
    $random2 = 1..2 | ForEach-Object { Get-Random -Maximum $nonchar.length }
    $private:ofs= "" 
    $ThePassword = [String]$characters[$random] + [String]$nonchar[$random2]
    return $ThePassword
}

$Users = (Get-ADUser -server $DC -filter * -Properties * -SearchBase $OU | select DisplayName, SamAccountNamee  )
FOREACH ($User in $Users) {
    $Username = $User.SamAccountName
    $DisplayName = $User.DisplayName
    $Password = Get-RandomPassword

    Write-host $DisplayName / $Username / $Password
    #Set-ADAccountPassword -id $username -NewPassword (ConvertTo-SecureString -AsPlainText $Password -Force)
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://heineborn.com/tech/resetting-password-for-specific-ou/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verifying User Home Directory</title>
		<link>http://heineborn.com/tech/verifying-user-home-directory/</link>
		<comments>http://heineborn.com/tech/verifying-user-home-directory/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 10:16:14 +0000</pubDate>
		<dc:creator>Joakim</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[File and Storage Services]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://heineborn.com/?p=1516</guid>
		<description><![CDATA[Some administrators prefer to do everything manually, other automated. I have always preferred to have as much as possible automated or at least set up with a script so the action can easily be repeated without varying end results.

I have written a script which verifies that all users that should have a home folder has one, and that it has the appropriate permissions.]]></description>
				<content:encoded><![CDATA[<p>Some administrators prefer to do everything manually, other automated. I have always preferred to have as much as possible automated or at least set up with a script so the action can easily be repeated without varying end results.</p>
<p>I have written a script which verifies that all users that should have a home folder has one, and that it has the appropriate permissions.<br />
If you use <strong>ADUC</strong> to set a home folder it per default gives the user <strong>Full Permissions</strong>, this is not optimal because it gives the end user the ability to change the permissions on their folders. I always prefer to give them <strong>Modify instead</strong>.</p>
<p>And sometimes the folder has mysteriously not been created on the server, or been deleted. This script will also fix that.</p>
<pre>

#  User Home Directory Permissions - heineborn.com 2013-01-15
#
#  Created a home folder for users who does not have one and sets correct permissions.

# Loading modules
Import-Module ActiveDirectory

$DC = "MYDC.HEINEBORN.LOCAL"
$OU = "OU=PRODUCTION,DC=HEINEBORN,DC=LOCAL"

$Content = (Get-ADUser -Server $DC -filter * -Properties * -SearchBase $OU | select SamAccountName, HomeDirectory )

FOREACH ($ID in $Content) {
    $User = $ID.SamAccountName
    $Folder = $ID.HomeDirectory
    # Check if the user has a HomeDirectory.
    If (($User -ne "SamAccountName") -and ($Folder)) { 
        # Check if folder exists, if not it created it.
        If ((Test-Path $Folder) -ne $true) {
            Write-Host
            Write-Host $User " HomeDirectory does not exist. Creating..."
            New-Item -ItemType directory -Path $Folder
            icacls $Folder /grant $User`:`(OI`)`(CI`)M
        }
        # Check if permissions are F (Full)
        $Icacls = icacls $Folder 
        $Match = "*" + $User + ":(F)*"
        $IcaclsResult = $Icacls -like $Match
        If ($IcaclsResult) {
            Write-Host
            Write-Host $User " HomeDirectory has incorrect permissions. Resetting..."
            icacls $Folder /remove:g $User
            icacls $Folder /grant $User`:`(OI`)`(CI`)M
        }
    }    
}
</pre>
<p>If this helped you or if you need assistance adjusting it let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://heineborn.com/tech/verifying-user-home-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCCM 2012, RevoDrive and 0x800700A1</title>
		<link>http://heineborn.com/tech/sccm-2012-revodrive-and-0x800700a1/</link>
		<comments>http://heineborn.com/tech/sccm-2012-revodrive-and-0x800700a1/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 09:29:37 +0000</pubDate>
		<dc:creator>Joakim</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Drivers]]></category>
		<category><![CDATA[MDT 2012]]></category>
		<category><![CDATA[RevoDrive]]></category>
		<category><![CDATA[SCCM 2012]]></category>
		<category><![CDATA[System Center]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[WDS]]></category>

		<guid isPermaLink="false">http://heineborn.com/?p=1500</guid>
		<description><![CDATA[Lately I've been struggling with deploying Windows 7 via SCCM 2012 to a workstation running a RevoDrive as primary storage. Right now the MDT scripts do not seem to think that the card is bootable.]]></description>
				<content:encoded><![CDATA[<p>Some of us want speed, and the fastest workstation storage with a decent price tag right now is <strong>OCZ RevoDrive</strong>. Its a PCI-E harddrive which can Read: Up to 1500 MB/s, Write: Up to 1250 MB/s and has Max Random Write 4KB (Aligned): 230,000 IOPS&#8230; Quite neat.</p>
<p>Whats not so neat, or fun is to get it to work with SCCM 2012.</p>
<p>I downloaded the latest drivers from OCZ and <strong>imported them to SCCM</strong> and my <strong>Boot Image</strong>.</p>
<p><a href="http://heineborn.com/upload/2013/02/SCCM-2012-RevoDrive.png" class="fancybox"><img src="http://heineborn.com/upload/2013/02/SCCM-2012-RevoDrive-650x214.png" alt="SCCM 2012 RevoDrive" width="650" height="214" class="aligncenter size-medium wp-image-1501" /></a></p>
<p>I then used <strong>DiskPart</strong> to set up the unit:</p>
<pre>
select disk 0
clean
create partition primary
select partition 1
active
format fs=ntfs quick
assign
exit
</pre>
<p><strong>WinPE</strong> boots fine but when I select my <strong>Task Sequence</strong> the installation stops with error code <strong>0x800700A1</strong>.</p>
<p>When checking <strong>SMSTS.log</strong> I find the following:</p>
<pre>


&#60;![LOG[User did not specify local data drive]LOG]!&#62;
&#60;![LOG[Volume C:\ has 480023437312 bytes of free space]LOG]!&#62;
<font color="red">&#60;![LOG[Volume C:\ is not bootable]LOG]!&#62;</font>
&#60;![LOG[Volume D:\ is not a fixed hard drive]LOG]!&#62;
&#60;![LOG[Volume E:\ is not a fixed hard drive]LOG]!&#62;
&#60;![LOG[Volume F:\ is not a fixed hard drive]LOG]!&#62;
&#60;![LOG[Volume G:\ is not a fixed hard drive]LOG]!&#62;
&#60;![LOG[Volume H:\ is not a fixed hard drive]LOG]!&#62;
&#60;![LOG[Volume X:\ is not a fixed hard drive]LOG]!&#62;
&#60;![LOG[TSM root drive = ]LOG]!&#62;
<font color="red">&#60;![LOG[We do not find an available volume to store the local data path]LOG]!&#62;</font>
</pre>
<p>The MDT scripts detect the RevoDrive as &#8220;not bootable&#8221;, I would prefer not to change any scripts in the package if possible. Is there another way to set up the hardware?</p>
<p>The hardware I&#8217;m trying to deploy on is a <strong>HP Z400</strong> (which is why I have so many drive letters) with a <strong>RevoDrive 3 x2</strong>.</p>
<p>I will keep working to solve the issue, if you&#8217;re having the same issue or got a solution let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://heineborn.com/tech/sccm-2012-revodrive-and-0x800700a1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Users Homefolder Permissions</title>
		<link>http://heineborn.com/tech/fix-users-homefolder-permissions/</link>
		<comments>http://heineborn.com/tech/fix-users-homefolder-permissions/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 14:56:58 +0000</pubDate>
		<dc:creator>Joakim</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[File and Storage Services]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://heineborn.com/?p=1474</guid>
		<description><![CDATA[The script will look through the a selected Organization Unit and verify that all users have a Home Directory set, and that it has the appropriate NTFS permissions.
Previously all users had Full-permissions on their home folder, which led to the users resetting permissions and removing unwanted permissions (Backup or Admin accounts) to their "private" stuff.]]></description>
				<content:encoded><![CDATA[<p>A step in making sure my customers AD and file server is safe and working (and is getting backed up properly) I designed a small Powershell-script. The script will look through the a selected Organization Unit and verify that all users have a Home Directory set, and that it has the appropriate NTFS permissions.</p>
<p>Previously <strong>all users had Full</strong>-permissions on their home folder, which led to the <strong>users resetting permissions</strong> and removing unwanted permissions (Backup or Admin accounts) to their &#8220;private&#8221; stuff.</p>
<p>This script will <strong>set Modify</strong>-permissions for the user. I know it&#8217;s not the most well-written script out there, but <strong>it works</strong>! :)</p>
<pre>
#	User Home Directory Permissions - heineborn.com 2013-01-15
#
#	Creates a HomeDirectory for users who are missing one.
#	Verifies they have Modify permissions, if they have Full it replaces with Modify.

# Loading modules
Import-Module ActiveDirectory

$DC = "DC01.HEINEBORN.LOCAL"
$OU = "OU=Users,DC=heineborn,DC=local"

$Content = (Get-ADUser -server $Dc -filter * -Properties * -SearchBase $OU | select SamAccountName, HomeDirectory)

FOREACH ($ID in $Content) {
    $User = $ID.SamAccountName
    $Folder = $ID.HomeDirectory
    # If the user does not have a value for HomeDirectory it skips.
    If ($Folder) { 
        # If the HomeDirectory does not exist its created.
        If ((Test-Path $Folder) -ne $true) {
            New-Item -ItemType directory -Path $Folder
            icacls $Folder /grant $User`:`(OI`)`(CI`)M
            }
        # Checking if user has Full permissions on their folder.
        $Icacls = icacls $Folder 
        $Match = "*" + $User + ":(F)*"
        $IcaclsResult = $Icacls -like $Match
        If ($IcaclsResult) {
            Write-Host $User " HomeDirectory has incorrect permissions. Resetting..."
            icacls $Folder /remove:g $User
            icacls $Folder /grant $User`:`(OI`)`(CI`)M
        }
    }    
}
</pre>
<p><a href="http://heineborn.com/upload/2013/01/advanced-security-settings.png" class="fancybox"><img src="http://heineborn.com/upload/2013/01/advanced-security-settings.png" alt="Advanced Security Settings" width="636" height="482" class="aligncenter size-full wp-image-1478" /></a></p>
<p>Let me know if anything is not working for you and I&#8217;ll do my best to help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://heineborn.com/tech/fix-users-homefolder-permissions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Make Primary User Local Admin in Task Sequence</title>
		<link>http://heineborn.com/tech/make-primary-user-admin-in-task-sequence/</link>
		<comments>http://heineborn.com/tech/make-primary-user-admin-in-task-sequence/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 21:54:36 +0000</pubDate>
		<dc:creator>Joakim</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SCCM 2012]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[System Center]]></category>
		<category><![CDATA[UDA]]></category>
		<category><![CDATA[UDI]]></category>
		<category><![CDATA[VBs]]></category>

		<guid isPermaLink="false">http://heineborn.com/?p=1448</guid>
		<description><![CDATA[I set up a small script which adds the username supplied during OSD to the local administrative group instead, which you could run from a TS. 
This way only the Primary User gets elevated privileges over their own PC.]]></description>
				<content:encoded><![CDATA[<p><a href="http://heineborn.com/upload/2013/01/UDA-Local-Admin.png" class="fancybox"><img src="http://heineborn.com/upload/2013/01/UDA-Local-Admin-650x246.png" alt="UDA in User Driven Installation" width="650" height="246" class="aligncenter size-medium wp-image-1456" /></a></p>
<p>I have been working on <strong>simplifying the deployment routine</strong> and increasing security for a customer.<br />
They are migrating from a Ghost-deployment to SCCM 2012, and currently security has not been considered at all.</p>
<p>The current policy is that <em>Domain Users</em> is set to be in all the clients local Administrators-group, which is just retarded.</p>
<p>I set up a small script which adds the <strong>username supplied during OS Deployment</strong> to the <strong>local administrators</strong> group instead, which you could run from a TS.<br />
This way only the Primary User gets elevated privileges over their PC (instead of the entire organization.</p>
<p>The script looks like this,</p>
<pre>
'	Configuration Manager Set UDA Local Admin - heineborn.com 2013-01-08
'
'	Enter UDA user during UDI wizard and this script will add that user to the local administrators group.

Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")
Set objShell = Wscript.CreateObject ("Wscript.Shell")
For Each oVar In oTSEnv.GetVariables
	If (ovar = "SMSTSUdaUsers") Then
		strCmd = "net localgroup Administrators /add " &#038; otsenv(ovar)
		objShell.Run (strCmd)
	End If
Next
</pre>
<p>I have integrated this SCCM installation with MDT so I simply saved the script in the MDT\Scripts-folder and added a Run Command Line step to my TS.</p>
<p><a href="http://heineborn.com/upload/2013/01/Set-UDA-in-TS.png" class="fancybox"><img src="http://heineborn.com/upload/2013/01/Set-UDA-in-TS-650x278.png" alt="Set UDA as Local adminstrator via Task Sequence" width="650" height="278" class="aligncenter size-medium wp-image-1457" /></a></p>
<p>If you need to set up User Device Affinity (prerequisite) I have written <a href="http://heineborn.com/tech/uda-with-mdt-2012-udi/" title="User Device Affinity with MDT 2012 UDI">a guide how to do that</a> aswell.</p>
<p>Hope this helped you.<br />
Leave a comment and feel free to link this page on other forums.</p>
]]></content:encoded>
			<wfw:commentRss>http://heineborn.com/tech/make-primary-user-admin-in-task-sequence/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
