Rename SamAccountName and Home Directory

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of SluBot SluBot 8 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34254
    Profile photo of SluBot
    SluBot
    Participant

    Greetings,

    I really require some help on this script I've been working on. We currently use GPO for folder/file redirection and its giving me issues when I run this script.

    We are in the process of standardizing our User login names to first letter + lastname. However, when I run this script and the user logs in, they are unable to create new folders on their desktop. They receive "No Object for Moniker error". I'm not sure what piece of the puzzle I'm missing here and could really use some help(Note, our folder/files are on a File Server on the network). I thought it would be as easy and just renaming the folder in the file server using the Rename-Item cmdlet and than just setting the home directory to the new file path with the new name...not so. The directory is showing up as their H: drive, but they are not able to create folder/files directly on their desktops, receiving that moniker error.

    Mind you, this only happens if the user logs on to the SAME PC with their new credentials. Their H: drive is there but they are unable to create folders/files on the desktop. HOWEVER, if they log on to a DIFFERENT PC, than all their old folders are there and they have no problems creating files/folders.

    I think this may have to do with the registry on the local PC holding on to those old credentials but I am not sure...

    Please see link to my code:
    Link to code: http://pastebin.com/LEahZ5AQ

    Thank you all for our help!

    #34257
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Yeah, it's not your script – it's a problem with the way Windows handles changes to folder redirection. Unfortunately, it's not really a PowerShell issue per se; we'll see if anyone jumps in with a suggestion, but you may want to post someplace broader like ServerFault.com also.

    #34259
    Profile photo of SluBot
    SluBot
    Participant

    Thank Don,

    I figured the script I wrote is fine, but thought I should reach out to the community just in case.

    I'll try my luck in ServerFault.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.