copying registry key

Home Forums Scripting PowerShell copying registry key

This topic contains 3 replies, has 3 voices, and was last updated by Avatar gogi100 2 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Avatar
    gogi100
    Member
    #166922

    i have powrshell script that find key that contains POP3 server, but i don’t know how found the key copying on same location and rename them

    my script is

    $destination= ‘hkcu:SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesTEST9375CFF0413111d3B88A00104B2A66766000000g’

    gci ‘hkcu:SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesTEST9375CFF0413111d3B88A00104B2A6676’ -recurse -ErrorAction SilentlyContinue |
    % { if((get-itemproperty -Path $_.PsPath) -match “POP3 Server”) { $_.Name; reg.exe copy $_.Name $destination /s /f} }

    I receive error message

    ERROR: Invalid key name

    Avatar
    Ossian
    Moderator
    #191589

    Have you checked that precise registry key exists?

    Avatar
    gogi100
    Member
    #334989

    i have in outlook 2010 one account. i want to create in outlook 2010 one more account that is same like previous account with different pop3/smtp settings because i have backup mail server. i thinked that this work do over registry

    Avatar
    wullieb1
    Moderator
    #245603

    That key won’t exist for all users as it is a user key, hkcu is HKEY_CURRENT_USER so the actual key will be different for each user on each PC.

    Wouldn’t it be easier to do this as part of the office installation?? run setup.exe /admin and generate a custom installation file which will contain your accounts.

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

You must be logged in to reply to this topic.