How can I use PowerShell 3.0 cmdlets or script to list all the local groups and local users of a server?

Using PowerShell 3.0 (And if possible the CIM, not WMI cmdlet), how can I script with | out-file C:\<filename>.txt or .csv option to list all local user accounts & local groups
on remote computers? 
Thank You!

I don't recall PowerShell V3 introducing anything new to handle local users and groups. You need to use PowerShell V1 methods, using the [ADSI] accelerator and the WinNT: provider. The scripts linked above show this. No need to use WMI (which would probably
be slower).
Here is a script I've used to enumerate all local groups and their members:
$Computer
= "MyServer"
$Computer =
[ADSI]"WinNT://$Computer"
$Groups =
$Computer.psbase.Children | Where {$_.psbase.schemaClassName
-eq "group"}
ForEach ($Group
In $Groups)
    "Group: "
+ $Group.Name
    $Members
= @($Group.psbase.Invoke("Members"))
    ForEach ($Member
In $Members)
        $Class
= $Member.GetType().InvokeMember("Class",
'GetProperty', $Null,
$Member, $Null)
        $Name
= $Member.GetType().InvokeMember("Name",
'GetProperty', $Null,
$Member, $Null)
        "-- Member: $Name ($Class)"
A similar script to enumerate all local users would be:
$Computer
= "MyServer"
$Computer =
[ADSI]"WinNT://$Computer"
$Users =
$Computer.psbase.Children | Where {$_.psbase.schemaClassName
-eq "user"}
ForEach ($User
In $Users)
    "User: "
+ $User.Name
Richard Mueller - MVP Directory Services

Similar Messages

  • How can i use 'find my iphone' if my iphone isnt connected to the internet or is currently out of battery?

    how can i use 'find my iPhone' if it isn't connected to the internet or is currently out of battery?

    You can't. It has to be on and able to connect to a network or it can't transmit its location.

  • I am moving to Alice Springs, Australia, this summer from the U.S. I would like to get the new iPad. How can I found out if I will be able to access all the functionality in Alice? Will I need to purchase a local plan of some sort?

    I am moving to Alice Springs, Australia, this summer from the U.S. I would like to get the new iPad to use while traveling back and forth from the U.S. to Australia, and within Australia. How can I found out if I will be able to access all the functionality of the iPad in Alice? Will I need to purchase a local plan of some sort? I have never owned an Apple product before -- I'm a newby!

    Aside form the limitation of LTE to the 700MHz and 2.1GHz bands (which rules out LTE in Europe I gather, at least as it stands now) the new iPad should let you use a GSM 3g/2g/edge network anywhere.  The CDMA Verizon model will only be able to use it's native CDMA radio band in the USA (that radio will be locked to Verizon), but it's international GSM radio is the same as the AT&T model.
    Keep in mind though that by far the cheapest option when abroad is to take advantage of free wifi as much as possible (well, that is always the cheapest option, since it is free).  I know several people who have taken their wifi-only iPads and iPad2s to Europe and said they did not find the lack of 3G really inconvenient at all as most towns had plenty of free or cheap wifi access all over the place.
    And in 3 years, your iPad will be at least 2-3 generations behind, LTE will have already been replaced by 5G or whatever the next new generation of cellular ends up being named (and the "young" kids will be wondering what the heck 3G even means or meant - dang that stuff was from the olden days!), and you can pitch that ancient piece of technology and start things all over again 

  • How can I transfer photos from my comp to my ipad2.I have the connection kit and can transfer photos that are direct from camera BUT if I transfer photos from comp to card it will not recognize them ????

    how can I transfer photos from my comp to my ipad2.I have the connection kit and can transfer photos that are direct from camera BUT if I transfer photos from comp to card it will not recognize them ????

    To sync photos from a Mac or Windows PC to your device using photo applications
    Make sure you have the latest version of iTunes installed.
    In iTunes, select your device's icon in the Devices list on the left.
    Click the Photos tab.
    Choose "Sync photos from."
    On a Mac, choose iPhoto or Aperture from the pop-up menu.
    On a Windows PC, choose Photoshop Album or Photoshop Elements from the pop-up menu.
    Note: Some versions of Photoshop Album and Photoshop Elements don't support collections. You can still use them to sync all your photos.
    If you want to sync all your photos, enable the option for "All photos, albums, events, and faces." If you want to sync photos from only some albums, events, or faces, enable the option for "Selected albums, events, and faces" and then select the albums you want. If syncing on a Mac with iPhoto version 6.0.6 or later, you may enable the option to "Include videos" to sync videos directly from iPhoto to your device. (Requires iOS 3.0 or later).
    Click Apply.
    To sync photos from a folder on your hard disk to your device
    Drag the images you want into a folder on your computer. If you want images to appear in separate photo albums on your device, create folders inside the main folder and drag images into the new folders.
    In iTunes, select the device icon in the Devices list on the left.
    Choose "Sync photos from."
    Select Choose Folder from the pop-up menu and choose your main image folder.
    Click Apply.

  • HT201210 how can i retrieve texts from an earlier back up without changing all the other settings on my iphone?

    how can i retrieve texts from an earlier back up without changing all the other settings on my iphone?

    You can't. Restoring from a backup is all or none.
    You can use a utility such as this one to extract the messages from the backup on your computer but you can't re-transfer the messages to the Messages app on your iPhone.
    http://msb.macsupport-pr.com/

  • How can I synch my ipod to a new computer without losing all my content, purchased and my old copied albums? My PC and backup died in the same week and now I am told I could lose all my content if I synch?

    how can I synch my ipod to a new computer without losing all my content, purchased and my old copied albums?
    My PC and backup died in the same week and now I am told I could lose all my content if I synch?
    I have new purchases on my new laptop but too paranoid to synch the ipod incase I lose the thousands of tunes I copied over from my old collections.

    See these 2 Links...
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991

  • I have just purchased a Macbook pro, but my iphone is currently synched to my old pc. How can I now synch it with my new mac without losing all the apps/music etc on my phone, Ta

    Hi, I have just purchased a Macbook, but my iphone is currently synched to my old pc. How can I now synch it with my new mac without losing all the apps/music etc on my phone? Ta

    The easiest way is to copy the iTunes folder from your old PC to your MB (put it in the Music folder as a subfolder), along with the other valuable data on the old PC. Or restore it from a backup of your old PC. Then authorize iTunes on the MB to the same account you had on the PC. When you sync it will warn you that your content will be deleted, but it will be replaced with the same content from the MB. Before syncing you should also make sure there is at least one entry in iCal and Address book on the MB (assuming you sync to Outlook or equivalent on the PC) to assure that your contacts and calendar entries will move over correctly.
    Al alternative that is less effective is to connect the iPhone to the MB without syncing, and choose "Transfer Purchases" from the iTunes File menu. This willl copy purchases music, videos and apps, but not ripped tracks from the iPhone to the MB.

  • HT1414 i think my iphone 4s has a damaged software because it locks the phone always and powers it off without touching the power button. how can i rectify this problem?? i already tried erasing all the settings and content of the phone. thanks..!

    i think my iphone 4s has a damaged software because it locks the phone always and powers it off without touching the power button. how can i rectify this problem?? i already tried erasing all the settings and content of the phone. thanks..!

    This is a user to user help forum only. You are not addressing Apple here.
    My iPhone 4S, iPhone 5, and iPad 2 are running 6.1.3 with no such problem and the same with the overwhelming majority of iOS devices running 6.1.3.

  • How can i sync my music on my phone with out loosing all the music thats already on it?

    When i click on "Sync Music" it say I will loose all music already on myphone how can i stop this?

    Specifically I'm looking to keep all my photo's on the phone.

  • All of the font on my webpages is in italics. How can I get it back to normal? I tried going through the Troubleshooting steps, and opening it in Safe Mode; that did not fix the problem.

    I went through an Adobe update and when my computer rebooted, the default font for everything was in italics. For example, when I go to Yahoo.com, the headings for all the news articles and tabs are in italics. I tried going through the Troubleshooting steps to no avail. I am frustrated because I followed the advice of checking the default font under Tools, then I opened the browser in Safe Mode, then I checked to make sure all the fonts were available. So how can I get my fonts back to normal? The italics gives me a headache.

    The usual cause of that issue is a corrupted or missing font that Firefox replaces by another, in this case a bold, font.
    As a test you can try to disable the default font and choose a few different fonts (Arial, Verdana, Tahoma, Times New Roman) to see if you can identify the culprit.<br />
    you will have to reinstall that corrupted font.

  • How can I use PowerShell to Remove "Ghost" (Old Hidden) VMware Network Adapters in Windows 7?

    We recently upgrade the virtual hardware of some of our VMware VM's running Windows 7. One side-effect is that in Windows on these machines, an instance of the NIC from the previous version of virtual hardware remains, as a hidden
    device. This can be easily found manually on a machine by enabling Device manager to show hidden devices (registry and a menu option - View...Show Hidden Devices). You can then just right-click on the device in question and uninstall.
    The problem here, like in so many other tasks, is that you may have multiple instances, on multiple machines. We had just that, and in scouring the internet for a PowerShell only script to resolve the issue, I could not find one. Therefore, I've written
    my own.
    This exact script is only seeking out VMware "VMXNET3" nic cards, but could be easily adapted to find Ghost NIC's for a different vendor using my example. There are also some commented lines left in to aid you as an example of how you can
    test the various queries in your own environment, on a test machine, before a full-blown deployment. 
    NOTE: Please try this out (at your own risk - I am not responsible for how this works out for you), and please vote for my answer to this dilemma if this helped you. I'd appreciate it after all of the sweat the script took to crank out.
    Thanks!
    P.S. This script, of course, requires that Powershell is installed and enabled on the target computer. It then must be run as System - In our environment it is being remotely pushed through a software delivery systems, which runs this scrpt
    as system.
    THE SCRIPT:
    CLS
    #Querying WMI for Ghost NICs and Returning Criteria...
     Write-Host "VMware Ghost NIC Remover" -Foreground GREEN
     Write-Host "Author: Octavio Serpa AKA Octavio-Admin"
     Write-Host "Copyright Octavio Serpa - Octavio-Admin - 2014"
     Write-Host ""
     Write-Host "Checking Powershell Version" -Foreground Yellow
     $host.version
     Write-Host ""
     Write-Host "Searching for Ghost NIC's" -Foreground Yellow
     $Ghosts = gwmi win32_NetworkAdapter | ?{$_.Description -like "vm*" -and $_.Installed -like "True" -and $_.MACAddress -eq $null}
     $Ghosts | Select-Object Name,DeviceID
     If ($Ghosts -NE $NULL)
      Write-Host "One or more ghost NIC'S do exist on this machine. Script will continue..." -foreground RED
      Write-Host ""    
      else
      Write-Host "No ghost NIC's Found :) - Exiting..." -Foreground Green
      Write-Host ""    
      EXIT 0
    #Using Criteria to Obtain the GUID of each Ghost NIC
     Write-Host "Getting NIC Variables" -Foreground Yellow
     foreach ($_ in $Ghosts) {
      $DID = $_.DeviceID
      If ($DID -NE $NULL)
      Write-Host "The NIC DID: $DID"
      else
      Write-Host "$DID is NULL - Exiting..."
      EXIT 666
      if($DID -NOTLIKE "1*")
       Write-Host "Adding additional 0 to registry lookup since the DID is just one character..." - foreground yellow
       Write-Host "" 
       $NICREG = Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\000$DID"
      ELSE
       $NICREG = Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00$DID"
      $GUID = $NICREG.NetCfgInstanceId
      Write-Host "The NIC GUID: $GUID"
                    $PNPDID = $NICREG.DeviceInstanceID
      $PNPDID = $PNPDID.Trimstart("PCI\VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01\")
      Write-Host "The truncated PNPDevice ID is $PNPDID"
      Write-Host ""
      Write-Host "Searching for Registry Keys that match NIC GUID: $GUID" -Foreground Yellow
      $NICREGPATH = @(1..50)
      foreach ($_ in $NICREGPATH)
       $TESTREG = Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\$_" -Verbose
       if($TESTREG -EQ $FALSE)
        #Write-Host ""
        #Write-Host "FALSE: HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\$_ DOES NOT EXIST" -Foreground RED     
        ELSE
        #Write-Host "True - NIC $_ Exists" -Foreground Green
        $NICID = $_    
        $SubPath1 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\'+$NICID
        #Write-Host "The Sub-Key Path To Query = $SubPath1"
        $SubPath2 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\NetworkCards\'+$NICID
        #Write-Host "The Sub-Key Path To Query = $SubPath2"
        $NICProperties = Get-ItemProperty $SubPath1
        #$NICProperties
        $Match = $NICProperties.ServiceName    
        #$Match
        foreach ($_ in $Match) {
        #Write-Host "The NIC GUID found in this registry key is: $_" -Foreground Yellow
        #Write-Host ""
        if($_ -NE $GUID)
        #Write-Host "NO MATCH - THIS NIC HAS NOT BEEN TOUCHED" -Foreground GREEN
                                    #Write-Host ""
        ELSE
        Write-Host "MATCH - Registry Entries for this NIC will be DELETED" -Foreground RED
        Remove-Item $SubPath1 -Recurse  -ErrorAction SilentlyContinue
        Remove-Item $SubPath2 -Recurse  -ErrorAction SilentlyContinue
        $CCS = @("ControlSet001", "ControlSet002")
        foreach ($_ in $CCS) {
         $CCS = $_
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Services\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose 
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Services\Tcpip\Parameters\Adapters\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\DeviceClasses\{ad498944-762f-11d0-8dcb-00c04fc3358c}\##?#PCI#VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01#$PNPDID#{ad498944-762f-11d0-8dcb-00c04fc3358c}\#'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\JNPRNA\Parameters\Adapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\NetBT\Parameters\Interfaces\Tcpip_' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Psched\Parameters\NdisAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\Adapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\DNSRegisteredAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\Interfaces\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\WfpLwf\Parameters\NdisAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
                                             if($DID -NOTLIKE
    "1*")
                  $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\000' + $DID
                             Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
           ELSE
           $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00' + $DID
           Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Enum\PCI\VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01\' + $PNPDID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
    #This is our Success check at the end
     Write-Host ""
     Write-Host "Searching for any remaining Ghost NICs:" -Foreground Yellow
              $Ghosts = gwmi win32_NetworkAdapter | ?{$_.Description -like "vm*" -and $_.Installed -like "True" -and $_.MACAddress -eq $null}
     $Ghosts | Select-Object Name,DeviceID
      If ($Ghosts -NE $NULL)
      Write-Host "There is still at least one ghost NIC present. The remover script may not be functioning correctly. Please contact Octavio-Admin on Microsoft Technet Forums with any questions" -foreground RED
      Write-Host ""
      EXIT 666
      else
      Write-Host "No ghost NIC's Found :) - Exiting..." -Foreground Green
      Write-Host ""    
      EXIT 0

    THE SCRIPT:
    CLS
    #Querying WMI for Ghost NICs and Returning Criteria...
    Write-Host "VMware Ghost NIC Remover" -Foreground GREEN
    Write-Host "Author: Octavio Serpa AKA Octavio-Admin"
    Write-Host "Copyright Octavio Serpa - Octavio-Admin - 2014"
    Write-Host ""
    Write-Host "Checking Powershell Version" -Foreground Yellow
    $host.version
    Write-Host ""
    Write-Host "Searching for Ghost NIC's" -Foreground Yellow
    $Ghosts = gwmi win32_NetworkAdapter | ?{$_.Description -like "vm*" -and $_.Installed -like "True" -and $_.MACAddress -eq $null}
    $Ghosts | Select-Object Name,DeviceID
    If ($Ghosts -NE $NULL)
      Write-Host "One or more ghost NIC'S do exist on this machine. Script will continue..." -foreground RED
      Write-Host ""   
      else
      Write-Host "No ghost NIC's Found :) - Exiting..." -Foreground Green
      Write-Host ""   
      EXIT 0
    #Using Criteria to Obtain the GUID of each Ghost NIC
    Write-Host "Getting NIC Variables" -Foreground Yellow
    foreach ($_ in $Ghosts) {
      $DID = $_.DeviceID
      If ($DID -NE $NULL)
      Write-Host "The NIC DID: $DID"
      else
      Write-Host "$DID is NULL - Exiting..."
      EXIT 666
      if($DID -NOTLIKE "1*")
       Write-Host "Adding additional 0 to registry lookup since the DID is just one character..." - foreground yellow
       Write-Host ""
       $NICREG = Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\000$DID"
      ELSE
       $NICREG = Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00$DID"
      $GUID = $NICREG.NetCfgInstanceId
      Write-Host "The NIC GUID: $GUID"
                    $PNPDID = $NICREG.DeviceInstanceID
      $PNPDID = $PNPDID.Trimstart("PCI\VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01\")
      Write-Host "The truncated PNPDevice ID is $PNPDID"
      Write-Host ""
      Write-Host "Searching for Registry Keys that match NIC GUID: $GUID" -Foreground Yellow
      $NICREGPATH = @(1..50)
      foreach ($_ in $NICREGPATH)
       $TESTREG = Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\$_" -Verbose
       if($TESTREG -EQ $FALSE)
        #Write-Host ""
        #Write-Host "FALSE: HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\$_ DOES NOT EXIST" -Foreground RED    
        ELSE
        #Write-Host "True - NIC $_ Exists" -Foreground Green
        $NICID = $_   
        $SubPath1 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\'+$NICID
        #Write-Host "The Sub-Key Path To Query = $SubPath1"
        $SubPath2 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\NetworkCards\'+$NICID
        #Write-Host "The Sub-Key Path To Query = $SubPath2"
        $NICProperties = Get-ItemProperty $SubPath1
        #$NICProperties
        $Match = $NICProperties.ServiceName   
        #$Match
        foreach ($_ in $Match) {
        #Write-Host "The NIC GUID found in this registry key is: $_" -Foreground Yellow
        #Write-Host ""
        if($_ -NE $GUID)
        #Write-Host "NO MATCH - THIS NIC HAS NOT BEEN TOUCHED" -Foreground GREEN
                                    #Write-Host ""
        ELSE
        Write-Host "MATCH - Registry Entries for this NIC will be DELETED" -Foreground RED
        Remove-Item $SubPath1 -Recurse  -ErrorAction SilentlyContinue
        Remove-Item $SubPath2 -Recurse  -ErrorAction SilentlyContinue
        $CCS = @("ControlSet001", "ControlSet002")
        foreach ($_ in $CCS) {
         $CCS = $_
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Services\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Services\Tcpip\Parameters\Adapters\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\DeviceClasses\{ad498944-762f-11d0-8dcb-00c04fc3358c}\##?#PCI#VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01#$PNPDID#{ad498944-762f-11d0-8dcb-00c04fc3358c}\#'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\JNPRNA\Parameters\Adapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\NetBT\Parameters\Interfaces\Tcpip_' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Psched\Parameters\NdisAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\Adapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\DNSRegisteredAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\Interfaces\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\WfpLwf\Parameters\NdisAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
                                             if($DID -NOTLIKE
    "1*")
                  $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\000' + $DID
                             Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
           ELSE
           $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00' + $DID
           Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Enum\PCI\VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01\' + $PNPDID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
    #This is our Success check at the end
    Write-Host ""
    Write-Host "Searching for any remaining Ghost NICs:" -Foreground Yellow
              $Ghosts = gwmi win32_NetworkAdapter | ?{$_.Description -like "vm*" -and $_.Installed -like "True" -and $_.MACAddress -eq $null}
    $Ghosts | Select-Object Name,DeviceID
      If ($Ghosts -NE $NULL)
    Write-Host "There is still at least one ghost NIC present. The remover script may not be functioning correctly. Please contact Octavio-Admin on Microsoft Technet Forums with any questions" -foreground RED
      Write-Host ""
      EXIT 666
      else
      Write-Host "No ghost NIC's Found :) - Exiting..." -Foreground Green
      Write-Host ""   
      EXIT 0
    Hello Octavio,
    I'm having similar issues with azure VMs (windows server 2008 and 2012). I noticed that the name of the network adapter changes every time the servers are turned off and then on.
    For example every time I perform that action on each VM, the network adapter became to "Microsoft Hyper-V Network Adapter #3" (and then #4, #5, etc).
    I found in to many forums that to resolve that is needed to remove Hidden (Ghost) Network Adapters and most of the people is doing that manually from the device manager (right click on the hidden network adapter and select uninstall).
    Then I found this script created by you and made some changes to find Description -like "Microsoft Hyper-V Network*".
    It seems to find the adapters and also remove them (based on the script results). But if I go to the device manager after restarting the server, all hidden (ghost) adapters are still there (for example Microsoft Hyper-V Network Adapter
    #2, Microsoft Hyper-V Network Adapter #3, Microsoft Hyper-V Network Adapter #4, Microsoft Hyper-V Network Adapter #n).
    The only thing I noticed after running the script is that, in the Control Panel -> Network and Sharing Center, the name of the adapter has no # (Now is shown as “Ethernet” and before as “Ethernet #”)
    This is my script, could you please take a look and tell me if there is something wrong o missing?
    CLS
    #Querying WMI for Ghost NICs and Returning Criteria...
    Write-Host "VMware Ghost NIC Remover" -Foreground GREEN
    Write-Host "Author: Octavio Serpa AKA Octavio-Admin"
    Write-Host "Copyright Octavio Serpa - Octavio-Admin - 2014"
    Write-Host ""
    Write-Host "Checking Powershell Version" -Foreground Yellow
    $host.version
    Write-Host ""
    Write-Host "Searching for Ghost NIC's" -Foreground Yellow
    $Ghosts = gwmi win32_NetworkAdapter | ?{$_.Description -like "Microsoft Hyper-V Network*" -and $_.Installed -like "True" -and $_.MACAddress -eq $null}
    $Ghosts | Select-Object Name,DeviceID
    If ($Ghosts -NE $NULL)
      Write-Host "One or more ghost NIC'S do exist on this machine. Script will continue..." -foreground RED
      Write-Host ""    
      else
      Write-Host "No ghost NIC's Found :) - Exiting..." -Foreground Green
      Write-Host ""    
      EXIT 0
    #Using Criteria to Obtain the GUID of each Ghost NIC
    Write-Host "Getting NIC Variables" -Foreground Yellow
    foreach ($_ in $Ghosts) {
      $DID = $_.DeviceID
      If ($DID -NE $NULL)
      Write-Host "The NIC DID: $DID"
      else
      Write-Host "$DID is NULL - Exiting..."
      EXIT 666
      if($DID -NOTLIKE "1*")
       Write-Host "Adding additional 0 to registry lookup since the DID is just one character..." - foreground yellow
       Write-Host "" 
       $NICREG = Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\000$DID"
      ELSE
       $NICREG = Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\00$DID"
      $GUID = $NICREG.NetCfgInstanceId
      Write-Host "The NIC GUID: $GUID"
                    $PNPDID = $NICREG.DeviceInstanceID
      $PNPDID = $PNPDID.Trimstart("PCI\VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01\")
      Write-Host "The truncated PNPDevice ID is $PNPDID"
      Write-Host ""
      Write-Host "Searching for Registry Keys that match NIC GUID: $GUID" -Foreground Yellow
      $NICREGPATH = @(1..50)
      foreach ($_ in $NICREGPATH)
       $TESTREG = Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\$_" -Verbose
       if($TESTREG -EQ $FALSE)
        #Write-Host ""
        #Write-Host "FALSE: HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\$_ DOES NOT EXIST" -Foreground RED     
        ELSE
        #Write-Host "True - NIC $_ Exists" -Foreground Green
        $NICID = $_   
        $SubPath1 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\'+$NICID
        #Write-Host "The Sub-Key Path To Query = $SubPath1"
        $SubPath2 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\NetworkCards\'+$NICID
        #Write-Host "The Sub-Key Path To Query = $SubPath2"
        $NICProperties = Get-ItemProperty $SubPath1
        #$NICProperties
        $Match = $NICProperties.ServiceName    
        #$Match
        foreach ($_ in $Match) {
        #Write-Host "The NIC GUID found in this registry key is: $_" -Foreground Yellow
        #Write-Host ""
        if($_ -NE $GUID)
        #Write-Host "NO MATCH - THIS NIC HAS NOT BEEN TOUCHED" -Foreground GREEN
                                    #Write-Host ""
        ELSE
        Write-Host "MATCH - Registry Entries for this NIC will be DELETED" -Foreground RED
        Remove-Item $SubPath1 -Recurse  -ErrorAction SilentlyContinue
        Remove-Item $SubPath2 -Recurse  -ErrorAction SilentlyContinue
        $CCS = @("ControlSet001", "ControlSet002")
        foreach ($_ in $CCS) {
         $CCS = $_
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Services\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose 
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Services\Tcpip\Parameters\Adapters\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\DeviceClasses\{ad498944-762f-11d0-8dcb-00c04fc3358c}\##?#PCI#VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01#$PNPDID#{ad498944-762f-11d0-8dcb-00c04fc3358c}\#'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\'+$GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\JNPRNA\Parameters\Adapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\NetBT\Parameters\Interfaces\Tcpip_' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Psched\Parameters\NdisAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\Adapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\DNSRegisteredAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\Tcpip\Parameters\Interfaces\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\services\WfpLwf\Parameters\NdisAdapters\' + $GUID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
                                             if($DID -NOTLIKE "1*")
                  $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\000' + $DID
                             Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
           ELSE
           $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00' + $DID
           Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
         $reg1 = 'HKLM:\SYSTEM\' + $CCS + '\Enum\PCI\VEN_15AD&DEV_07B0&SUBSYS_07B015AD&REV_01\' + $PNPDID
         Remove-Item $reg1 -Recurse  -ErrorAction SilentlyContinue -verbose
    #This is our Success check at the end
    Write-Host ""
    Write-Host "Searching for any remaining Ghost NICs:" -Foreground Yellow
              $Ghosts = gwmi win32_NetworkAdapter | ?{$_.Description -like "Microsoft Hyper-V Network*" -and $_.Installed -like "True" -and $_.MACAddress -eq $null}
    $Ghosts | Select-Object Name,DeviceID
      If ($Ghosts -NE $NULL)
    Write-Host "There is still at least one ghost NIC present. The remover script may not be functioning correctly. Please contact Octavio-Admin on Microsoft Technet Forums with any questions" -foreground RED
      Write-Host ""
      EXIT 666
      else
      Write-Host "No ghost NIC's Found :) - Exiting..." -Foreground Green
      Write-Host ""    
      EXIT 0

  • The car gauge app available from the itunes store utilizes an OBDII Bluetooth adapter, but I can't configure the Bluetooth address. How can I use this app I just installed, it has to have the Bluetooth address configured.

    I saw an advertisement in a car magazine for an app that would provide gauge read outs available for download from the app store. So I went to the app store, found the app, downloaded and installed it. I then purchased the Bluetooth OBD hardware adapter required to transmit the data from the car to the phone. The adapter has to be configured for the app to communicate with it. This is an apple approved app. But everything I've read says that apple will not allow iPhone owners to make any adjustments to their Bluetooth addresses. And that iPhone only provides Bluetooth connectivity to basic head sets speakers and audio formats through the car stereos ( but no audio streaming). 
    Bottom line, apple approved app and hardware that can't be configured unless I perform a jailbreak? I don't want to JB the phone but it seems that apple has left me with no other options. I've already invested time and money on this software and hardware. Their must be a legitimate way to use this apple approved software. Does anyone know how to adjust/configure bluetooth settings/addresses?

    Generally, if you have to enter a code for bluetooth, your iPhone will ask you to enter a 4 digit code when pairing.  Check the instructions for the device you are trying to pair with your iPhone.  The instructions should give you the code in the pairing instructions, if a code is required.

  • How can i cancel my other nickname from gamecenter, i want to all the devices to use same nickname.

    i registered my user name before in gamecenter, but my daughter made the other nickname in the game center later that affect my other ipad and iphone to sharing the same application. i want to all the devices to use same username, can you tell me how to cancel my daughter's nickname on her ipad.

    You are using icloud?
    maybe your account is not whit icloud and thats the problem
    o you dont have the same account in your iphone and ipad

  • How can I use my airport extreme to connect a windows machine to the internet? I don't have the software disks anymore...

    I no longer have any disks for my airport extreme (its pre-time capsule)... how can I connect my windows machine to it in order to get to the internet?

    You can directly download the AirPort Utility for Windows from Apple Support here.
    Once the AirPort Extreme is properly configured for Internet access you can connect your PC to the Extreme either by a wired or wireless connection.

  • How can i use 2 facebook accounts in firefox without every time change the inlog and password?

    My wive and me have both a facebook account . When my facebook account is on, and she want on facebook she most change the login name and password. Now i have use Maxthon and this browser has an option save as web app. ande thats working fine. Now i love Firefox, so my question is . is there an option like web app with maxthon fot firefox?
    ps. sorry for my english

    hello hassie1954, you could try if the CookieSwap addon can accomplish that: https://addons.mozilla.org/firefox/addon/cookieswap

Maybe you are looking for

  • Firefox refuses to be removed form PC using XP Pro. Why?

    Using control panel add/remove program facilty has no effect in removal. My on line banking page only partially loads so that I cannot acress accounts

  • Logic Pro x out of phase

    I was recording a new song and making some piano edits by playing with an earlier piano track.  I completed one section edit fine.  When I went to record another section suddenly my keyboard was out of phase with my earlier keyboard track.  I have on

  • Can't load purchased items on iPhone or iPad

    Purchased items will not appear. iTunes crashes when attempting load.

  • Julian Style Date Formatting

    Post Author: Brian Black CA Forum: Formula Our AS/400 based banking software provides dates in the format yyyyddd (i.e. 2007091 = April 01, 2007).  Has anyone had any experience working with a date of this format in Crystal.  The date comes out of th

  • HNSC and App store

    My UAT set up: WFE name: abc.sharepoint.com Non host header site at port 80: http://abc.sharepoint.com  IIS for this site: http with ip * For App store: Added https binding on port 80 with new ip and app store certificate Extended abc.sharepoint.com