إضغط لتفاصيل الإعلانات



Results 1 to 2 of 2
Share
  1. #1
    Join Date
    Nov 2007
    Location
    Arab world!
    Posts
    6,169
    Blog Entries
    4
    Rep Power
    10

    Thumbs up Add registry keys remotely using Powershell

    How to add registry keys remotely using the Powershell

    Filed under: Exchange, Exchange Management Shell | Tags: Exchange 2007, Powershell, Exchange 2010 |

    I was looking for a way to add registry keys to multiple remote servers. Discovering the fact that legacy commands like REG ADD works in Powershell was pure bliss. The following simple script will add/verify registry entries remotely.

    Code:
    $ServerList = Get-Content RegList.txt
    foreach( $Server in $ServerList)
    {
    Write-host -foregroundcolor Cyan Server Name : $Server
    $x=”"
    # Add the registry keys
    REG ADD \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v InstallPath /t REG_EXPAND_SZ /d “D:\PROGRAM FILES\GIGATRUST”
    REG ADD \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v PurgeCheckIntervalMinutes /t REG_DWORD /d 15
    REG ADD \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v PurgeCutoffDays /t REG_DWORD /d 30
    REG ADD \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v RMCachePath  /t REG_EXPAND_SZ /d “D:\PROGRAM FILES\GIGATRUST\BESRMCACHE”
    # Verify the keys
    REG QUERY \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v InstallPath
    REG QUERY \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v PurgeCheckIntervalMinutes
    REG QUERY \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v PurgeCutoffDays
    REG QUERY \\$Server\HKLM\Software\GigaTrust\GTBESExtension /v RMCachePath
    write-host -foregroundcolor Yellow “Press any key to to continue”
    # Command to wait for user to press a key.
    $x = $host.UI.RawUI.ReadKey(“NoEcho,IncludeKeyDown,AllowCtrlC”)
    }
    Write-host -foregroundcolor Green “Completed”

    The result will look like this:
    Last edited by Mohamed Fouad; 03-08-2010 at 10:23 AM.


  2. Facebook Comments - تعليقـك على الفيس بوك يسعدنا ويطور مجهوداتنـا


  3. Forum Ads:

  4. Forum Ads:

    اضفط هنا لمعرفة تفاصيل الإعلانات بالموقع


  5. Forum Ads:

    -->

  6. #2
    Join Date
    Dec 2007
    Location
    Cairo, Al Qahirah, Egypt, 115351105145884, Cairo, Egypt
    Posts
    2,229
    Blog Entries
    1
    Rep Power
    15

Similar Threads

  1. visual certexam suite setup and Registry key
    By Mohamed Fouad in forum Programs & Maintenance
    Replies: 11
    Last Post: 13-10-2012, 03:51 AM
  2. Replies: 0
    Last Post: 05-08-2010, 08:18 PM
  3. Replies: 1
    Last Post: 13-07-2010, 08:15 PM
  4. Replies: 1
    Last Post: 03-09-2009, 10:29 AM
  5. Replies: 1
    Last Post: 10-03-2009, 12:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

أقسام المنتدى

الروابط النصية

تابع جروبنا على الفيس بوك

صفحة Egypt Engineers على الفيس بوك

تابعنا على linkedin

جروبنا على الياهو جروب