<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Add username textfile to Microsoft User Profile Disks fileshare	</title>
	<atom:link href="https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/</link>
	<description>-={ The Nutanix and EUC GURU }=-</description>
	<lastBuildDate>Thu, 13 Apr 2023 09:14:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Jeroen Tielen		</title>
		<link>https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/#comment-263</link>

		<dc:creator><![CDATA[Jeroen Tielen]]></dc:creator>
		<pubDate>Thu, 13 Apr 2023 09:14:20 +0000</pubDate>
		<guid isPermaLink="false">https://www.jeroentielen.nl/?p=6598#comment-263</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/#comment-262&quot;&gt;sysadmin47&lt;/a&gt;.

Hi Kevin,

UPD should not be used anymore. You should switch to FSLogix ;)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/#comment-262">sysadmin47</a>.</p>
<p>Hi Kevin,</p>
<p>UPD should not be used anymore. You should switch to FSLogix 😉</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sysadmin47		</title>
		<link>https://www.jeroentielen.nl/add-username-textfile-microsoft-user-profile-disks-fileshare/#comment-262</link>

		<dc:creator><![CDATA[sysadmin47]]></dc:creator>
		<pubDate>Thu, 13 Apr 2023 06:41:37 +0000</pubDate>
		<guid isPermaLink="false">https://www.jeroentielen.nl/?p=6598#comment-262</guid>

					<description><![CDATA[I found this script from https://learn.microsoft.com/en-us/answers/questions/1005700/show-usermame-linked-to-upd-drive

I would like to point out that your script doesn&#039;t properly handle the situation where the user has been deleted. The script will apply the username from a previous file, because the variables are not initialized each time.

I am not a coder either, but I have updated the script to put &quot;UNKNOWN&quot; if the SID cannot be translated back to a username.

#-------------------------------- Script --------------------------------  
   
$Files = gci $UPD_Location -Name  
   
Foreach ($SID in $Files) {  
        If ($SID -match &quot;.vhdx&quot;) {  
            $SID = $SID.Substring(5) -replace &quot;.vhdx&quot;  
            If ($SID-match &quot;template&quot;) {  
                Write-Host &quot;Template File&quot;  
            } Else {
                $objUser = &quot;UNKNOWN&quot;
                $UserName = &quot;UNKNOWN&quot;
                $objSID = New-Object System.Security.Principal.SecurityIdentifier ($SID)  
                $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])  
                $UserName = $objUSer.Value.trim(&quot;$DomainName\&quot;)   
                $TextFile = $UPD_Location + &quot;\UVHD-&quot; + $SID + &quot; &quot; + $UserName + &quot;.txt&quot;  
                New-Item $TextFile -ItemType file -Force  
            }  
        }  
}]]></description>
			<content:encoded><![CDATA[<p>I found this script from <a href="https://learn.microsoft.com/en-us/answers/questions/1005700/show-usermame-linked-to-upd-drive" rel="nofollow ugc">https://learn.microsoft.com/en-us/answers/questions/1005700/show-usermame-linked-to-upd-drive</a></p>
<p>I would like to point out that your script doesn&#8217;t properly handle the situation where the user has been deleted. The script will apply the username from a previous file, because the variables are not initialized each time.</p>
<p>I am not a coder either, but I have updated the script to put &#8220;UNKNOWN&#8221; if the SID cannot be translated back to a username.</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; Script &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;  </p>
<p>$Files = gci $UPD_Location -Name  </p>
<p>Foreach ($SID in $Files) {<br />
        If ($SID -match &#8220;.vhdx&#8221;) {<br />
            $SID = $SID.Substring(5) -replace &#8220;.vhdx&#8221;<br />
            If ($SID-match &#8220;template&#8221;) {<br />
                Write-Host &#8220;Template File&#8221;<br />
            } Else {<br />
                $objUser = &#8220;UNKNOWN&#8221;<br />
                $UserName = &#8220;UNKNOWN&#8221;<br />
                $objSID = New-Object System.Security.Principal.SecurityIdentifier ($SID)<br />
                $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])<br />
                $UserName = $objUSer.Value.trim(&#8220;$DomainName\&#8221;)<br />
                $TextFile = $UPD_Location + &#8220;\UVHD-&#8221; + $SID + &#8221; &#8221; + $UserName + &#8220;.txt&#8221;<br />
                New-Item $TextFile -ItemType file -Force<br />
            }<br />
        }<br />
}</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
