<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx</link><description>Hi Rob here again. I recently had a customer that needed the functionality of MoveUser.exe from the Windows 2000 Resource Kit available in Windows Vista. The customer had quite a few Windows Vista machines that were not joined to the domain but were now</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3122645</link><pubDate>Thu, 11 Sep 2008 23:23:16 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3122645</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;I ran into a few problems trying to use this script. &amp;nbsp;First, the variable strDomainDN was not defined in your DIM statements. Second, the quote marks on line 41 - strDomainDN=”dc=contoso,dc=com” are the wrong type and generate an error. &amp;nbsp;And third, on line 117 you have the &amp;quot;_&amp;quot; to indicate that the command is continued on the next line, but there is no carraige return so the script errors out again there. &amp;nbsp;Once I changed those three items and edited the appropiate variables for the user I was wanting to move, the script ran - and I saw the info for all the users scroll through the command window - However, the user's profile wasn't moved. &amp;nbsp;When I logged in using the AD account, it created a new profile rather than using the one I tried to move. &amp;nbsp;What I put in for variable looks mostly like this:&lt;/p&gt;
&lt;p&gt;strComputer =&amp;quot;.&amp;quot; &lt;/p&gt;
&lt;p&gt;strSourceAcct=&amp;quot;fred&amp;quot; &lt;/p&gt;
&lt;p&gt;strSourceAcctDomain=&amp;quot;Test-MigVista01&amp;quot; &lt;/p&gt;
&lt;p&gt;strTargetAcct=&amp;quot;wilsonf&amp;quot; &lt;/p&gt;
&lt;p&gt;strTargetAcctDomain=&amp;quot;UNIVERSITY&amp;quot; &lt;/p&gt;
&lt;p&gt;strDomainDN=&amp;quot;dc=university,dc=edu&amp;quot;&lt;/p&gt;
&lt;p&gt;The script runs without errors but the profile doesn't seem to move. &amp;nbsp;But when I log the computer in using 'wilsonf@university.edu' it generates a new profile.&lt;/p&gt;
&lt;p&gt;Am I missing something?&lt;/p&gt;
&lt;p&gt;==Ron.&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3122676</link><pubDate>Fri, 12 Sep 2008 00:07:17 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3122676</guid><dc:creator>NedPyle</dc:creator><description>&lt;p&gt;Rob's taking a look at this now; once he irons it all out I will update the main post. Thanks for writing all this up Ron!&lt;/p&gt;
&lt;p&gt;- Ned&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3122712</link><pubDate>Fri, 12 Sep 2008 01:49:59 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3122712</guid><dc:creator>NedPyle</dc:creator><description>&lt;p&gt;Ok folks, try it again. The script got a bit tanked up by the blogging formatting, but the two functional errors should be fixed. It was not actually correctly building the full SID string, due to over-engineering. :)&lt;/p&gt;
&lt;p&gt;- Ned&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3122941</link><pubDate>Fri, 12 Sep 2008 15:27:49 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3122941</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;That fixed it. &amp;nbsp;Migrated the profile perfectly, just like the old moveuser.exe did with XP.&lt;/p&gt;
&lt;p&gt;Thank you very much. &amp;nbsp;I really needed a script like this right now - and from what I found on the 'net, lot's of other people are looking for it, as well.&lt;/p&gt;
&lt;p&gt;==Ron.&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3122954</link><pubDate>Fri, 12 Sep 2008 16:11:44 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3122954</guid><dc:creator>NedPyle</dc:creator><description>&lt;p&gt;That's great Ron, glad it worked for you. :)&lt;/p&gt;
&lt;p&gt;- Ned&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3123170</link><pubDate>Fri, 12 Sep 2008 23:51:50 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3123170</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;By adding the ability to accept command line arguments, and a few lines of code to process them, I made the script function nearly identically to the previous exe version - and I don't have to edit the script every time I run it. ( you still have to edit one master variable - strDomainDN=&amp;quot;dc=Contoso,dc=com&amp;quot;&lt;/p&gt;
&lt;p&gt;and make it whatever your domain is - but that would probably be a one-time edit for most admins.) &amp;nbsp;So now, I can launch the command prompt (as admin, of course) and simply type: &lt;/p&gt;
&lt;p&gt; &amp;nbsp;Moveuser user1 DOMAIN\user1&lt;/p&gt;
&lt;p&gt;just as before. (this way runs with wscript instead of cscript but it still works.)&lt;/p&gt;
&lt;p&gt;Here is what I added:&lt;/p&gt;
&lt;p&gt;'/========================&lt;/p&gt;
&lt;p&gt;DIM strDomAcctLength, strCompName, strSlashPos&lt;/p&gt;
&lt;p&gt;DIM strDomainAcct, strLocalAcct, strLocalAcctLength&lt;/p&gt;
&lt;p&gt;If WScript.Arguments.Count = 2 Then&lt;/p&gt;
&lt;p&gt; strLocalAcct = WScript.Arguments.Item(0)&lt;/p&gt;
&lt;p&gt; strDomainAcct = WScript.Arguments.Item(1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; Wscript.Echo &amp;quot;Usage 1: Moveuser.vbs LocalUsername Domain\Username&amp;quot; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;amp; VBNewLine &amp;amp; &amp;quot;or...&amp;quot; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;amp; VBNewLine &amp;amp; &amp;quot;Usage 2: Moveuser.vbs Domain\Username Domain\Username&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; Wscript.Quit&lt;/p&gt;
&lt;p&gt;End If&lt;/p&gt;
&lt;p&gt;'Process arg 1'&lt;/p&gt;
&lt;p&gt;If InStr (strLocalAcct, &amp;quot;\&amp;quot;) = 0 Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Set strCompName = WScript.CreateObject(&amp;quot;WScript.Network&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;strSourceAcctDomain = strCompName.ComputerName&lt;/p&gt;
&lt;p&gt; &amp;nbsp;strSourceAcct = strLocalAcct&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;strLocalAcctLength = Len(strLocalAcct)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;strSlashPos = InStr (strLocalAcct, &amp;quot;\&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;strSourceAcctDomain = Left(strLocalAcct,strSlashPos - 1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;strSourceAcct = Right(strLocalAcct,strLocalAcctLength - strSlashPos)&lt;/p&gt;
&lt;p&gt;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp;'Process arg 2'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;strDomAcctLength = Len(strDomainAcct)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;strSlashPos = InStr (strDomainAcct, &amp;quot;\&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;strTargetAcctDomain = Left(strDomainAcct,strSlashPos - 1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;strTargetAcct = Right(strDomainAcct,strDomAcctLength - strSlashPos)&lt;/p&gt;
&lt;p&gt;'/=== the lines below resume from the original ===&lt;/p&gt;
&lt;p&gt;strComputer =&amp;quot;.&amp;quot; &lt;/p&gt;
&lt;p&gt;strDomainDN=&amp;quot;dc=Contoso,dc=com&amp;quot;&lt;/p&gt;
&lt;p&gt;strTargetAcctSID=&amp;quot;&amp;quot; &lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3123174</link><pubDate>Sat, 13 Sep 2008 00:08:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3123174</guid><dc:creator>NedPyle</dc:creator><description>&lt;p&gt;Hey, that's great Ron! I tried to pummel Rob into doing that as well but he had other things going on and took the easy way out. :)&lt;/p&gt;
&lt;p&gt;Thanks very much for providing that sample for people here, I'm sure they will find it useful.&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125312</link><pubDate>Wed, 17 Sep 2008 20:37:09 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125312</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;I ran across another problem... &amp;nbsp;When I try to run the script to change an account from a Domain to a local user (instead of the other way around...), I get the following error:&lt;/p&gt;
&lt;p&gt;(116, 13) SWbemObjectEx: The parameter is incorrect.&lt;/p&gt;
&lt;p&gt;What I have for the variables is similar to before, but in reverse:&lt;/p&gt;
&lt;p&gt;strComputer =&amp;quot;.&amp;quot;&lt;/p&gt;
&lt;p&gt;strSourceAcct=&amp;quot;wilsonf&amp;quot;&lt;/p&gt;
&lt;p&gt;strSourceAcctDomain=&amp;quot;UNIVERSITY&amp;quot;&lt;/p&gt;
&lt;p&gt;strTargetAcct=&amp;quot;fred&amp;quot;&lt;/p&gt;
&lt;p&gt;strTargetAcctDomain=&amp;quot;Test-MigVista20&amp;quot;&lt;/p&gt;
&lt;p&gt;strDomainDN=&amp;quot;dc=university,dc=edu&amp;quot;&lt;/p&gt;
&lt;p&gt;It's almost as if the &amp;quot;ObjProfile.ChangeOwner&amp;quot; doesn't work in this direction.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125316</link><pubDate>Wed, 17 Sep 2008 20:46:14 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125316</guid><dc:creator>NedPyle</dc:creator><description>&lt;p&gt;I'd be very suspicious of that ever working - it's not something I've ever seen anyone ask for, which means the product group that designed that function probably didn't consider it (usually the reverse, no one gets rid of AD; they are trying to get rid of workgroups). I'll see if I can get a definitive answer on that for you.&lt;/p&gt;
&lt;p&gt;- Ned&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125331</link><pubDate>Wed, 17 Sep 2008 21:09:08 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125331</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;Where Rob spells out the description for each of the variables above, it &amp;quot;sounds&amp;quot; like it should work. &amp;nbsp;Not sure if it worked with the old Moveuser.exe or not. &amp;nbsp;Perhaps I'll test that out...&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125336</link><pubDate>Wed, 17 Sep 2008 21:28:13 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125336</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;Just tested the Moveuser.exe under XP and was able to successfully revert a user from the domain back to being a local user.&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125472</link><pubDate>Thu, 18 Sep 2008 03:40:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125472</guid><dc:creator>Rob Greene</dc:creator><description>&lt;p&gt;Hey Ron,&lt;/p&gt;
&lt;p&gt;So the problem here is not functionality of the WMI Provider. &amp;nbsp;The issue here is the script. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;So the issue with the script is that it is hard coded to look at active directory for the Target account. &lt;/p&gt;
&lt;p&gt;If you read the comments around the objProfile.ChangeOwner method in the script it requires a string representation of the users SID i.e. &amp;quot;S-1-5-21.....&amp;quot; then it needs a flag setting.&lt;/p&gt;
&lt;p&gt;=============================&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' ChangeOwner method requires to String SID of Target Account and a Flag setting &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Flag 1 = Change ownership of the source profile to target account even if the target account &amp;nbsp;already has a profile on the system. &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Flag 2 = Delete the target account Profile and change ownership of the source user account profile to the target account. &lt;/p&gt;
&lt;p&gt;==============================&lt;/p&gt;
&lt;p&gt;The script shown above assumes that the target account is a domain based account, since that is what most customers reqire. &amp;nbsp;That is why the script does an LDAP query for the user in question and gets a HEX representation of the users SID. &amp;nbsp;It then converts the HEX SID to a Text SID.&lt;/p&gt;
&lt;p&gt;So here is the rub, the script would have to be modified to look at the local SAM acocunt database and search it for the users SID to make it work. &amp;nbsp;Otherwise if you know off the top of you head the users SID you can use that as the first parameter in the method.&lt;/p&gt;
&lt;p&gt;Now you could connect to the WINNT provider to find the users local account or the WMI provider of Win32_UserAccount&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/aa394507.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa394507.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope that this helps.&lt;/p&gt;
&lt;p&gt;Rob Greene&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125759</link><pubDate>Thu, 18 Sep 2008 18:31:16 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125759</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;Thanks for the info. &amp;nbsp;I understand now why it doesn't work in the reverse direction. &amp;nbsp;Now I need to decide if I want to go through the work of adding that functionality for something that really will rarely (if ever) be used.&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3125873</link><pubDate>Fri, 19 Sep 2008 00:59:17 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125873</guid><dc:creator>Rob Greene</dc:creator><description>&lt;p&gt;Hey Ron,&lt;/p&gt;
&lt;p&gt;I totally understand that. &amp;nbsp;However, if you do choose to do this we would be glad to have the code added to the comments sectoin &amp;nbsp;;)&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3126089</link><pubDate>Fri, 19 Sep 2008 16:28:59 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3126089</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;I might tackle this later... &amp;nbsp;I've been editing the script to make it closer to the old MoveUser.exe because we are going to begin a 'mass migration' next week, converting ~600 remaining users from Novell to AD. &amp;nbsp;I wanted my instructions for the team to be as close to identical for both XP and Vista as I could get them. &amp;nbsp;I've made so many changes now that simply posting a code-snip wouldn't work very well. &amp;nbsp;I'm telling our team to get the file from:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://tacklebox.cns.ohiou.edu/Moveuser/"&gt;http://tacklebox.cns.ohiou.edu/Moveuser/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to check out the changes in the file, let me know what you think... (and if you see any problems that I've missed.)&lt;/p&gt;
&lt;p&gt;Converting profiles back really isn't an issue right now - but in a University environment we get piles of requests that make all of us say &amp;quot;Why would they want to do that?&amp;quot; - But we aren't generally able to say 'no' unless it's trully imposible (and sometimes not even then...) So while I would like to have the 'ability' to move them back, I don't have the time to write and test that before we begin. And I doubt I'll have the need right away.&lt;/p&gt;
&lt;p&gt;So,... here we go........&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3127824</link><pubDate>Wed, 24 Sep 2008 19:59:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3127824</guid><dc:creator>Rob Greene</dc:creator><description>&lt;p&gt;Hey Ron,&lt;/p&gt;
&lt;p&gt;So I took a look at you site listed above. &amp;nbsp;Top notch, I really like how you took the concept of the script and totally made it into something that you as well as other customers can use. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have to give you the extra kodos of adding all the documentation around how to use the script on the website. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for taking interest in our blogging efforts and giving back to the community with the additions to the script.&lt;/p&gt;
</description></item><item><title>Das "Active Directory" Team online...</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3130801</link><pubDate>Wed, 01 Oct 2008 17:58:52 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3130801</guid><dc:creator>.: Michael Korp :.</dc:creator><description>&lt;p&gt;Auch das Active Directory Team betreibt ein Blog , dass ich interessant zu lesen finde. Gestolpert dar&amp;amp;#252;ber&lt;/p&gt;
</description></item><item><title>Top AskDS Blog Posts</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3156578</link><pubDate>Thu, 20 Nov 2008 00:52:21 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3156578</guid><dc:creator>Ask the Directory Services Team</dc:creator><description>&lt;p&gt;We’ve been at this for over a year (since August 2007), with more than 100 posts (127 to be exact), so&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3218089</link><pubDate>Wed, 25 Mar 2009 22:09:55 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3218089</guid><dc:creator>TechRon</dc:creator><description>&lt;p&gt;I know it has been a while, and this thread is likely dead - but I recently tested my current version of the script on a Windows 7 beta installation and after a couple of minor tweaks to the error checking bits, it now works with Windows 7 just fine. (Though I still haven't gone back to try to fit in the 'move back to a local account' option...)&lt;/p&gt;
&lt;p&gt;Oh,... and our mass migration of the Novell users went beautifully.&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3233753</link><pubDate>Fri, 01 May 2009 00:42:13 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3233753</guid><dc:creator>perennialmind</dc:creator><description>&lt;p&gt;For what it's worth, I ran into some trouble with the VBScript replacement and ended up using the following PowerShell script instead. &amp;nbsp;As Rob Greene suggested, I pulled the SIDs from Win32_UserAccount. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;[code]&lt;/p&gt;
&lt;p&gt;$original_user = get-wmiobject -class &amp;quot;Win32_UserAccount&amp;quot; -namespace &amp;quot;root\cimv2&amp;quot; -filter &amp;quot;Name='user1' AND LocalAccount=True&amp;quot;&lt;/p&gt;
&lt;p&gt;$new_user = get-wmiobject -class &amp;quot;Win32_UserAccount&amp;quot; -namespace &amp;quot;root\cimv2&amp;quot; -filter &amp;quot;Name='user1' AND Domain='CONTOSO'&amp;quot;&lt;/p&gt;
&lt;p&gt;$profile = get-wmiobject -class &amp;quot;Win32_UserProfile&amp;quot; -namespace &amp;quot;root\cimv2&amp;quot; -filter &amp;quot;SID='$($original_user.SID)'&amp;quot;&lt;/p&gt;
&lt;p&gt;$profile.ChangeOwner($new_user.SID, [uint32]0)&lt;/p&gt;
&lt;p&gt;[/code]&lt;/p&gt;
&lt;p&gt;Which could be even shorter:&lt;/p&gt;
&lt;p&gt;[code]&lt;/p&gt;
&lt;p&gt;$original_user = get-wmiobject &amp;quot;Win32_UserAccount WHERE Name='user1' AND LocalAccount=True&amp;quot;&lt;/p&gt;
&lt;p&gt;$new_user = get-wmiobject &amp;quot;Win32_UserAccount WHERE Name='user1' AND Domain='CONTOSO'&amp;quot;&lt;/p&gt;
&lt;p&gt;$profile = get-wmiobject &amp;quot;Win32_UserProfile WHERE SID='$($original_user.SID)'&amp;quot;&lt;/p&gt;
&lt;p&gt;$profile.ChangeOwner($new_user.SID, 0)&lt;/p&gt;
&lt;p&gt;[/code]&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3233777</link><pubDate>Fri, 01 May 2009 02:14:45 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3233777</guid><dc:creator>Rob Greene</dc:creator><description>&lt;p&gt;Hey perennialmind,&lt;/p&gt;
&lt;p&gt;Thats great coding.&lt;/p&gt;
&lt;p&gt;I am sorry to hear that you had issues with the VBScript.&lt;/p&gt;
&lt;p&gt;Rob Greene&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3259667</link><pubDate>Mon, 29 Jun 2009 18:58:58 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3259667</guid><dc:creator>the shrimp's steel</dc:creator><description>&lt;p&gt;thank's a lot, i will try your script Rob, but if it's doesn't works with my park, this powerShell Scritp works ? (I just change in row 2 &amp;quot;Domain='Tralala'&amp;quot;&lt;/p&gt;
&lt;p&gt;[code]&lt;/p&gt;
&lt;p&gt;$original_user = get-wmiobject &amp;quot;Win32_UserAccount WHERE Name='user1' AND Domain='Tralala'&amp;quot;&lt;/p&gt;
&lt;p&gt;$new_user = get-wmiobject &amp;quot;Win32_UserAccount WHERE Name='user1' AND Domain='CONTOSO'&amp;quot;&lt;/p&gt;
&lt;p&gt;$profile = get-wmiobject &amp;quot;Win32_UserProfile WHERE SID='$($original_user.SID)'&amp;quot;&lt;/p&gt;
&lt;p&gt;$profile.ChangeOwner($new_user.SID, 0)&lt;/p&gt;
&lt;p&gt;[/code]&lt;/p&gt;
&lt;p&gt;And i have a another question for both script (vbs and PowerShell), when do I run the script ? when I'm the admin of the first domain (source) or the final domain (target), after created a user profil in the new domain ?&lt;/p&gt;
&lt;p&gt;by default, your script doesn't delete the source account I guess ?&lt;/p&gt;
&lt;p&gt;Rob, Do you marry me ?&lt;/p&gt;
&lt;p&gt;I have no further question.&lt;/p&gt;
&lt;p&gt;the shrimp's stell&lt;/p&gt;
</description></item><item><title>re: Vista’s MoveUser.exe replacement</title><link>http://blogs.technet.com/askds/archive/2008/09/09/vista-s-moveuser-exe-replacement.aspx#3263450</link><pubDate>Mon, 13 Jul 2009 18:24:52 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3263450</guid><dc:creator>Rob Greene</dc:creator><description>&lt;p&gt;Hey Shrimp's Stell,&lt;/p&gt;
&lt;p&gt;I have to be honest here with you, I have not really taken the time to learn anything at this point about Powershell scripting in general.&lt;/p&gt;
&lt;p&gt;However, I think your script is going to have a problem unless both the source and target accounts have logged onto the machine at least once. &amp;nbsp;Since you are calling the WMI Win32_UserAccount class.&lt;/p&gt;
&lt;p&gt;Rob Greene&lt;/p&gt;
</description></item></channel></rss>