Using Powershell Studio to control Hyper-v VMs and VHDs

Hello everyone! I'm kind of new to Powershell in general, and to Powershell Studio
alltogether.
I'm trying to use Powershell Studio to write a script (with a GUI) that behaves like
this:
Two Windows. On one side there's a window that shows me the list of VMs on my machine.
Once I click on one of them, the window on the right shows me the attached VHDs that VM has.
I can't figure out how to integrate the Get-VM command to display unto a window. I'd
be happy for any help anyone can offer. Cheers and Merry Christmas to all :D

Hi Noamatan,
I also recommend you can consult Sapien expert:
http://www.sapien.com/forums/viewforum.php?f=21
In addition, The Powershell Studio project below is for your reference, which build a drop downlist, then we can display the result by selecting the item in dropdown list:
Building GUI for PowerShell Scripts using PowerShell Studio 2012
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Similar Messages

  • DPM 2012 R2 Backup job FAILED for some Hyper-v VMs and Some Hyper-v VMs are not appearing in the DPM

    DPM 2012 R2  Backup job FAILED for some Hyper-v VMs
    DPM encountered a retryable VSS error. (ID 30112 Details: VssError:The writer experienced a transient error.  If the backup process is retried,
    the error may not reoccur.
     (0x800423F3))
    All the vss Writers are in stable state
    Also Some Hyper-v VMs are not appearing in the DPM 2012 R2 Console When I try to create the Protection Group please note that they are not part of cluster.
    Host is 2012 R2 and The VM is also 2012 R2.

    Hi,
    What update rollup are you running on the DPM 2012 R2 server ?  DPM 2012 R2 UR5 introduced a new refresh feature that will re-enumerate data sources on an individual protected server.
    Check for VSS errors inside the guests that are having problems being backed up.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT]
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Unable to Build VC++ application it showing error 1 LINK : fatal error LNK1104: cannot open file 'NiFieldPoint71D.lib' but I am Using Measurement Studio 2009 ,NI DAQ 7.01 and Field Point 6.05.

    I am having a application in Visual Studio 2003 on Windows XP  , Now I am Migrating the application in Visual Studio 2005 on Windows-7 .
    In my Development PC , I was install Measurement Studio 2009 ,  NI DAQ 7.01 and Field Point 6.05.
    my application is Showing following error:
    Linking...
    LINK : fatal error LNK1104: cannot open file 'NiFieldPoint71D.lib'
    Build log was saved at "file://c:\EdacsNt\Source\SaftyServices\NICfpDAQDl?l\Debug\BuildLog.htm"
    NICfpDAQDll - 1 error(s), 0 warning(s)
    When I copy from NiFieldPoint71D.lib library from Measurement Studio 7.1 and put in :\Program Files\National Instruments\MeasurementStudioVS2005\VCNET\Lib.
    my application is Showing following error:
    1>Linking...
    1>atlsd.lib(atltrace.obj) : error LNK2005: "unsigned int (__stdcall* ATL::g_pfnGetThreadACP)(void)" (?g_pfnGetThreadACP@ATL@@3P6GIXZA) already defined in NiFieldPoint71D.lib(StdAfx.obj)
    1>atlsd.lib(atlbase.obj) : error LNK2005: "class ATL::CAtlWinModule ATL::_AtlWinModule" (?_AtlWinModule@ATL@@3VCAtlWinModule@1@A) already defined in NiFieldPoint71D.lib(StdAfx.obj)
    1>   Creating library ..\..\lib\debug\NICfpDAQDll.lib and object ..\..\lib\debug\NICfpDAQDll.exp
    1>..\..\bin\debug\NICfpDAQDll.dll : fatal error LNK1169: one or more multiply defined symbols found
    I want to ignore NiFieldPoint71D.lib from using project setting(Linker->Input->ignore Specific Library ) but still it is showing same error.
    In the project Setting I am done following setting:
    "C:\Program Files\National Instruments\MeasurementStudioVS2005\VCNET\Lib";"
    C:\Program Files\National Instruments\NI-DAQ\Lib"
    Linker->Input->ignore Specific Library: mfcs71d.lib;libc.lib;'NiFieldPoint71D.lib
    Please provide some solution.
    Thanks
    Nityanand

    You posted this in the LabVIEW forum.
    Are you programming in LabVIEW?
    There is a separate Measurement Studio for VC++ forum. http://forums.ni.com/t5/Measurement-Studio-for-VC/bd-p/231

  • [SOLVED] - How to Rename a Win 7 Computer Using Powershell (deployment)

    For those who just want to know what I'm trying to do here's my question:
    How I can programmatically rename machines during the auditSystem/auditUser portion of Sysprep using PowerShell?
    What is the exact command and/or function should I be issuing?
    History:
    I've scoured the web for a while but unsuccessfully located what I was looking for.  I'm preparing a Windows 7 Enterprise x86 image for deployment, and I need to rename the machine to match our current PC name schema before it is joined to the domain. 
    I've managed to pull the information I needed to build the corret computer name thanks to Win32_BIOS.SerialNumber, Win32_ComputerSystem.Model and some IP<->Hashtable Array matching.  The next step is to actually rename the machine; This is
    where I'm having trouble.
    I found this code online :
    Function Rename-ComputerName ([string]$NewComputerName){
    $ComputerInfo = Get-WmiObject -Class Win32_ComputerSystem
    $ComputerInfo.rename($NewComputerName)}
    I also found
    this code online :
    function renameAndReboot([string]$computer, [string]$newname){
    $comp = gwmi win32_computersystem  -computer $computer
    $os   = gwmi win32_operatingsystem -computer $computer
    $comp.Rename($newname)
    $os.Reboot()}
    Unfortunately, neither work in PowerShell on my reference image PC running Windows 7.  (However the first one works in PowerShell on my XP Virtual PC.)
    The ReturnValue is 1326 when run on the Win 7 machine as the Administrator.  I'm not quite certain I understand what & why that fails or what exactly that code means.
    Moving on, I decided to go down the WMIC path instead:
     WMIC ComputerSystem where Name="%computername%" call Rename Name="$NewName"
    This works in CMD.exe on Windows XP and to my surprise, in CMD.exe on Windows 7 as well!  But, when run from PowerShell I get "Error: Invalid query".
    Thinking PowerShell might not like the CMD.exe %COMPUTERNAME% environment variable, I sprang for the PowerShell $env:computername environment variable instead:
     WMIC ComputerSystem where Name="$env:computername" call Rename Name="$NewName"
    That unfortunately results in an 'Unexpected switch at this level' error.
    Other suggestions I've seen online were to use netdom, but that's not part of the Win 7 install and since I've historically been able to do this through WMI calls, it should be possible to do this in Win 7, Vista, Server etc.
    I'm completely open to the idea that perhaps I'm doing something wrong.  If you have a tested solution, please share.

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
    <component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SkipRearm>1</SkipRearm>
    </component>
    </settings>
    <settings pass="specialize">
    <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <RunSynchronous>
    <RunSynchronousCommand wcm:action="add">
    <Order>1</Order>
    <Path>net user administrator /active:yes</Path>
    </RunSynchronousCommand>
    </RunSynchronous>
    </component>
    <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SkipAutoActivation>true</SkipAutoActivation>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <OEMInformation>
    <Manufacturer>Company Name</Manufacturer>
    <Model>Company Owned Hardware</Model>
    <SupportHours>Mon-Fri 8 AM - 8 PM Central Time; excluding Holidays</SupportHours>
    <SupportPhone>1-888-xxx-xxxx</SupportPhone>
    <SupportURL>http://our.support.url.information</SupportURL>
    <Logo>%WINDIR%\WallPapr2.bmp</Logo>
    </OEMInformation>
    <OEMWelcomeCenter>
    <link>http://our.helpdesk.information</link>
    </OEMWelcomeCenter>
    <ComputerName></ComputerName>
    <CopyProfile>true</CopyProfile>
    <ShowWindowsLive>false</ShowWindowsLive>
    <TimeZone>Central Standard Time</TimeZone>
    <ProductKey>FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4</ProductKey>
    </component>
    <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Identification>
    <Credentials>
    <Domain>domainname</Domain>
    <Password>password</Password>
    <Username>domainadmin</Username>
    </Credentials>
    <JoinDomain>domainname</JoinDomain>
    <MachineObjectOU>OU=OU Information,DC=com</MachineObjectOU>
    </Identification>
    </component>
    </settings>
    <settings pass="oobeSystem">
    <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <InputLocale>en-us</InputLocale>
    <SystemLocale>en-us</SystemLocale>
    <UILanguage>en-us</UILanguage>
    <UserLocale>en-us</UserLocale>
    <UILanguageFallback>en-us</UILanguageFallback>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <AutoLogon>
    <Password>
    <Value>encrypted info</Value>
    <PlainText>false</PlainText>
    </Password>
    <Enabled>true</Enabled>
    <LogonCount>3</LogonCount>
    <Username>administrator</Username>
    </AutoLogon>
    <FirstLogonCommands>
    <SynchronousCommand wcm:action="add">
    <CommandLine>%WINDIR%\Setup\Scripts\NewPC1.cmd</CommandLine>
    <Description>Change Machine Name and Reboot</Description>
    <Order>1</Order>
    <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
    <CommandLine>%WINDIR%\Setup\Scripts\NewPC2.cmd</CommandLine>
    <Order>2</Order>
    <RequiresUserInput>false</RequiresUserInput>
    <Description>More Cleanup Work</Description>
    </SynchronousCommand>
    </FirstLogonCommands>
    <OEMInformation>
    <Manufacturer>Company Name</Manufacturer>
    <Model>Company Owned Hardware</Model>
    <SupportHours>M-F, 8 am - 8 pm Central excluding Holidays</SupportHours>
    <SupportPhone>1-888-xxx-xxxx</SupportPhone>
    <SupportURL>http://our.support.url.information</SupportURL>
    </OEMInformation>
    <OEMWelcomeCenter>
    <link>http://our.helpdesk.information</link>
    </OEMWelcomeCenter>
    <OOBE>
    <HideEULAPage>true</HideEULAPage>
    <NetworkLocation>Work</NetworkLocation>
    <ProtectYourPC>3</ProtectYourPC>
    </OOBE>
    <UserAccounts>
    <AdministratorPassword>
    <Value>encrypted info</Value>
    <PlainText>false</PlainText>
    </AdministratorPassword>
    <LocalAccounts>
    <LocalAccount wcm:action="add">
    <Password>
    <Value>encrypted info</Value>
    <PlainText>false</PlainText>
    </Password>
    <Description>Local Administrator</Description>
    <DisplayName>Administrator</DisplayName>
    <Group>Administrators</Group>
    <Name>Administrator</Name>
    </LocalAccount>
    </LocalAccounts>
    </UserAccounts>
    <RegisteredOrganization>Company Name</RegisteredOrganization>
    <RegisteredOwner>Licensed CompanyEmployee</RegisteredOwner>
    <TimeZone>Central standard Time</TimeZone>
    </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:location/of/install.wim#Windows 7 PROFESSIONAL" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    Jnaas. My Answer file?
    I hope I didnt leave anything incriminating in that file...
    The product key is the generic one for Windows 7 to tell it to use the KMS server.

  • Used Apple Studio Display, Possibly Ruined

    Hello all,
    I purchased a used Apple Studio Display a few days ago and thought nothing of it at the time (I was picking up some used Macs for friends, and it was an afterthought). I figured, what the h*ll.
    So anyway, I finally hooked it up, and was very impressed with the color calibration and overall usefulness of the monitor. The problem was it was very dirty and covered with scratches.
    So, not knowing any better, I proceeded to use some glass cleaner on it, and this got a lot of black residue off the screen, which made things look noticeably cleaner. The bad news was that this was a lot of work, and I was looking for a more "quick and dirty" (poor choice of words, I suppose) method of getting it cleaned up. So I pulled out the "Goo Gone," a commercial product that smells a bit like oranges but which also has some petroleum distillates in it.
    Anyway, long story short: Although the window cleaner and the craptastic miracle cleaner did a bang-up job insofar as the removal of the black matter, there are a few areas of the screen where I was a little too vigorous and have buffed the shine away, leaving a blurred image underneath. Who knew that the screen had a protective plastic coating? Not me, I suppose.
    So I've googled around for some kits to repair the mistake I have made, and I'm coming up empty. I see multitudinous products for cleaning the monitor, and of course I wish I had found them before I endeavored to clean this monitor (it was disgusting, I tell you! Even with the blurring, it's still an improvement!). I still can't find a product to make this puppy shine like it's supposed to.
    There remain a few noticeable scratches on the monitor, and of course I would like to buff those out if possible, but most importantly, I'd like to be able to get back the clarity I thought I was heading for (before I cleaned a little too hard!).
    Responses chiding me for my overzealous cleaning behavior are discouraged, as I am primarily interested in climbing out of the hole I'm in, not in getting shoved further down it.
    Thanks in advance,
    Art

    Well, I'm going to go ahead and answer my own question.
    I attempted to take apart the monitor to take out the smudged glare screen. I was unsuccessful; it's glued directly to the glass in such a way that its removal would have made things much worse.
    When I put it all back together, the monitor no longer worked!
    Oh well, easy come, easy go.

  • Current version of integration services on Hyper V host and ugrading versions on VM's

    Greetings!
    I am looking for where the latest version number of integration services is posted, so I may verify what it should be. I am able to query using powershell the vm's on the hosts and get a return of the current version installed. However, I seem to be
    unable to find out the current version of IS on the hosts themselves. How do I get this information?

    With all current releases of Hyper-V:
    When you patch your Hyper-V Server and reboot, the vmguest.iso is generated dynamically to match the release of the Hyper-V Server.
    This is historic and was designed to ensure compatibility of the ICs in the VM with the Services of the host.
    That said, only Hyper-V 2012 R2 can give you the 'latest' integration components, but they might not function well if VMs are moved to older versions of Hyper-V.  That is why 2012 R2 in a VM is 'not supported' on Hyper-V 2008 R2 or 2008 (for example).
    In the future Integration Components will be through Windows Update (if your Hyper-V Server is 'Windows 10" or later):
    http://blogs.technet.com/b/virtualization/archive/2014/11/11/hyper-v-integration-components-are-available-through-windows-update.aspx
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • How to manage a connection with powershell using visual studio with C#

    Hi
     I want to manage a connection with powershell for a web app using visual studio with c#. and also run command with pipeline 
    Plz give a some suggestions..

    Hi Raj_Kumar_Saini,
    To make things clear, could you please clarify these thing?
    1. Do you mean you want to execute some PowerShell scripts from C# language? These blogposts may give you  some ideas:
    Executing PowerShell scripts from C#
    Powershell Automation and Remoting (a c# love story)
    Execute PowerShell from a ASP.NET Web Application
    2. Is your question related to Visual Studio Integration? Do you want to build a Visual Studio Extension?
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to save the value in Cedit control into a text file bu using measurement studio c++?

    Im using measurement studio c++ to create a application. How to save a randomly generated value which display in the CNumberEdit Control to a text file? how to do the coding part?

    You can use the CNiFile class to write the value out to a file. For example, create a new Measurement Studio C++ project and follow these steps:
    Add a CNiNumEdit to the dialog.
    Add a member variable for the CNiNumEdit called m_numEdit.
    Add a button to the dialog.
    Double-click the button to add a message handler for the button's BN_CLICKED message.
    Add the following code to the button's BN_CLICKED message handler:
    CNiFile file("C:\\Values.log", CFile::modeCreate | CFile::modeWrite | CFile::typeText);
    file << m_numEdit.Value << endl;
    file.Close();
    Run the application, edit the CNiNumEdit's value, and click the button. The value should be written to the Values.log
    file as specified in the code above.
    Hope this helps.
    - Elton

  • How to Install/UnInstall Visual studio extension using PowerShell

    Hi all.
    I try to install / uninstall visual studio extension use PowerShell script
    But I just can find the Install like: start-process $visualextendsionpath.
    I can't not find the way to uninstall the extension.
    Do I use this command to install is correct? And please suggest me the way to unInstall the extension by PowerShell script.
    Thank

    Hi Bruce,
    In addition, Since I'm not familar the VSIX, however, to uninstall package with powershell, these cmdlets are for your reference:
    Removes an app package (.appx): Remove-AppxPackage
    To get the installed package :
    Get-AppxPackage
    Or if you want to uninstall app listed in 'Add or Remove Programs', please also check this script:
    $app = Get-WmiObject -Class Win32_Product | Where-Object {
    $_.Name -match "Software Name"
    $app.Uninstall()
    If there is anything regarding this script, please feel free to post back.
    Best Regards,
    Anna Wang

  • 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

  • Hyper-V VMs memory utilization

    Hi,
    Please let me know the WMI class (query) to check the memory utilization for all the VMs under the Hyper-V host.
    Thanks & Regards,
    Raamesh Keerthi N J

    Hi ,
    I would recommend you to use powershell command " Get-vm " to get the memory usage of the VM .
    As for using WMI to get the VM's memory usage(I am assuming you are using server2012r2 ) , please try the command below :
    $RequestInfo = 1,103,112
    $VmInfo = Get-WmiObject -namespace root\virtualization\v2 -class msvm_virtualsystemmanagementservice
    $VmInfo.getsummaryinformation($null,$RequestInfo).summaryinformation
    For the WMI class syntax please refer to following article :
    http://blogs.msdn.com/b/virtual_pc_guy/archive/2013/04/29/powershell-script-to-tell-you-if-you-need-to-update-your-integration-services.aspx
    If you have further more question about WMI , please post it here :
    http://social.technet.microsoft.com/Forums/en-us/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Using real instruments to control software instruments

    I recently bought the Apogee Duet to play my guitars and keyboard directly into Garageband (and soon Logic Studio). My problem is that I haven't been able to figure out how to control software instruments using real instruments. For example, is there way for me to connect my Piano Keyboard through Duet into my computer, but use it to play software tracks like strings and horns, etc? I would like to do this without using MIDI, since I just spent $500 on the Duet. Is this possible, or is the only way to control software instruments through an external instrument by using MIDI? Thanks so much for any help....

    Assuming your keyboard requires an external MIDI interface (some have MIDI interfaces onboard), you can pick one up pretty cheaply - for example, M-Audio's Midisport or Uno are decent and inexpensive.

  • Can I assign several physical storage locations for each virtual machine when using the replication-feature from Hyper-V 2012 R2?

    Hi everyone,
    I have 2x physical servers running Hyper-V 2012 R2. Each hosts several virtual machines. The VHDs of the VMs are stored on several dedicated physical disks to have a performance boost. For exampe if VM A has two VHDs attached I made sure that the VHDs are
    on different physical disks to have them not slow-down each other in case of intensive disk accesses.
    So far so good. I was looking forward to the replication-feature. The idea is to have the two physical servers have their primary running VMs being replicated to the other physical server and vice-versa. I was hoping to have the chance to choose for each
    individual VM where the replicated VHD will be stored. But instead I can only see the one location/path which is configured in Hyper-V Manager when I activate the replication-feature on the server.
    Is there by any chance a way how to select the storage location for each VHD/VM if using the replication-feature of Hyper-V 2012 R2?
    Thanks in advance.
    Cheers,
    Sebastian

    Secondly, you could replicate different VMs to different storage locations to perform some of the disk balancing you are trying to perform.  Lastly, you could copy the vhd file to a different location
    before starting the VM.
    .:|:.:|:. tim
    Hi Tim,
    thanks for the reply. Sorry, but I had some other tasks to take care of, so I wasn't paying enough attention to this thread.
    The part I quoted from your reply sounds exactly like the action I'd like to perform, but as you pointed out before this should not be possible.
    How can I perform the action (replicating each VM to a storage location) as you mentioned secondly? To sum it up again:
    2x physical machines carrying severel HDDs
    8+ VMs spread to run on the 2x servers
    when setting up replication I can only set the storage-location from server A on B and vice versa B on A
    Thanks again for your reply.
    Cheers,
    Sebastian

  • Using powershell to deploy provider-hosted app and specify remote Url instead of using appinv.aspx page

    Hello all,
    Could you possibly help me with provider-hosted app development/deployment process.
    We developed SharePoint provider-hosted app that works just fine in development environment. Now we need to automate it's installation in test environment via powershell.
    In AppManifest.xml that we are deploying we have key instead of explicit URL:
    <App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShowAllRoomsApp" ProductID="{922a18aa-5592-b59a-4da9-4791baef02e7}" Version="1.0.0.0"
    SharePointMinVersion="15.0.0.0">
      <Properties>
        <Title>SomeTitle</Title>
        <StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
    If we use as
    https://technet.microsoft.com/en-us/library/jj655398.aspx recommends, we cannot specify Redirect Url as we can do this on
    /_layouts/appinv.aspx
    So now it seems like the only way to deploy this kind of solution is using appinv.aspx page.Or must we apply this URL in AppManifest on developing stage in Visual Studio?
    What did I miss?
    P. S. Even if I use /_layouts/appinv.aspx after powershell commandlets, I get error.

    hi,
    to deploy provider hosted app you need 2 things
    1. Client ID
    2. Redirect URL.
    What you can do you can generate app from visual studio using clientID and URL from developer enviornment.
    Now a app file is just a simple compressed zip file if you rename it as .zip and extract you will find AppManifest
    inside it. So to create an app for Testing enviornment what you have to to Get the CLient ID (from AppRegNew.aspx) in testing enviornment. Unzip .App file change the AppManifest with testing client ID and URL than again zip file and rename as .app.
    Now if you upload this file it will work.
    To automate this scenerio i have created a simple windows Application in which i Pass the Client ID and StartURl and an App File it unzips the app file make changes to app and again zip it.
    public static class AppPackageHelper
    public const string StartUrlExpression = "{0}?{1}";
    public const string StandardToken = "{StandardTokens}";
    public static string Publish(string appPath, string ClientId,string StartUrl)
    string tempDir = string.Empty;
    string outPutFile = string.Empty;
    try
    string parentDir = System.IO.Path.GetDirectoryName(appPath);
    outPutFile = System.IO.Path.Combine(parentDir, ClientId + "-Winshuttle.app");
    tempDir = System.IO.Path.Combine(parentDir, ClientId.ToString());
    Directory.CreateDirectory(tempDir);
    int lastInd = appPath.LastIndexOf('.');
    string tempPath = string.Empty;
    string targetFilePath = string.Empty;
    string cabPath = System.IO.Path.Combine(tempDir, System.IO.Path.GetFileNameWithoutExtension(appPath) + ".cab");
    FileInfo fInfo = new FileInfo(appPath) { IsReadOnly = false };
    File.Copy(appPath, cabPath);
    XDocument doc = null;
    string appManifest = string.Empty;
    using (ZipArchive zipArch = ZipFile.Open(cabPath, ZipArchiveMode.Update))
    appManifest = string.Format(@"{0}\AppManifest.xml", Directory.GetParent(cabPath).FullName);
    ZipArchiveEntry manifestEntry = zipArch.Entries.LastOrDefault(e => e.Name.ToLower() == "appmanifest.xml");
    manifestEntry.ExtractToFile(appManifest);
    doc = XDocument.Load(appManifest);
    XNamespace ns = doc.Root.GetDefaultNamespace();
    string defaultUrl = string.Format(StartUrlExpression, StartUrl.TrimEnd('/'), StandardToken);
    doc.Descendants(XName.Get("StartPage", ns.NamespaceName)).First().Value = defaultUrl;
    doc.Descendants(XName.Get("RemoteWebApplication", ns.NamespaceName)).First().Attribute(XName.Get("ClientId")).Value = setupInfo.ClientId.ToString();
    doc.Save(appManifest);
    if (manifestEntry != null)
    manifestEntry.Delete();
    zipArch.CreateEntryFromFile(appManifest, "AppManifest.xml");
    int totEnt = zipArch.Entries.Count;
    for (int e = 0; e < totEnt; e++)
    if (zipArch.Entries[e].Open().Length == 0)
    //if (zipArch.Entries.Count > totEnt && e >= totEnt) break;
    //zipArch.CreateEntry(zipArch.Entries[e].FullName);
    File.Delete(appManifest);
    if (File.Exists(outPutFile))
    File.Delete(outPutFile);
    File.Move(cabPath, outPutFile);
    return outPutFile;
    catch
    throw;
    finally
    if (System.IO.Directory.Exists(tempDir))
    System.IO.Directory.Delete(tempDir, true);
    return outPutFile;
    using System.IO.Compression.FileSystem.dll.
    Also if you want to do it using powershell You need to do the same thing unzip-> changes values-> zip
    So basic thing is You need to ahve only valid AppManifest file which contains 2 valid values Client Id and StartUrl
    if you changes it inside appmanifest manuall than it will also work. Using above code you can create a console Application to do it. You can use powershell it just that i dont know how to zip unzip in powershell but i am pretty sure you can easily find it
    on searching.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Custom List Form creation using Powershell - SharePoint 2013

    Hi,
    I have a custom List called 'IssuesList' with 4 fields - "IssueTitle","IssueID","IssueDesc","Status"
    While displaying display form I should show 3 fields expect Issue ID i.e. IssueID should be hidden.
    and on edit form only Status field should be editable. So using SharePoint designer I created respective Edit form and display forms and changed XSLT to control the display mode on the fields.
    I have everything scripted in powershell till now - creation of custom list, publishing pages, webparts etc. however I am looking for how to provision or associate these 2 list forms with IssuesList after I create the list in new site.
    I have restrictions on using wsp and site/list template due to business needs. So I need to know if there is any way I can upload these 2 files after I create custom list in powershell and associate them as defaultdisplay and defauteditforms?
    Please advise.

    Hi,
    Per my understanding, you might need to apply these custom forms to a list after list creation using PowerShell.
    With PowerShell with SharePoint Object Model, we can hide fields on list forms.
    The similar thread below with code snippet will provide more information about this:
    https://social.technet.microsoft.com/Forums/en-US/ee6fc2eb-197f-4144-94fa-8a4e438675d9/hide-a-field-from-edit-form-list?forum=sharepointgeneralprevious
    If there may be other requirements except for hiding fields, as you have limitation on using custom solution package(which should be preferable in such scenario),
    a workaround I can provide is that, after list creation, you can add Content Editor Web Part contains the CSS style or JavaScript to the form pages of a specific list, it will help you hide/disable the specific elements, this can be achieved programmatically.
    The code below can add a Content Editor Web Part to the DisplayForm of a list(though in C#):
    public static void AddCEWP()
    SPLimitedWebPartManager manager = null;
    SPFile file = null;
    using (SPSite site = new SPSite("http://sp"))
    using (SPWeb web = site.RootWeb)
    try
    web.AllowUnsafeUpdates = true;
    file = web.GetFile(web.Url + "/Lists/List018/DispForm.aspx");
    manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared);
    ContentEditorWebPart webPart = new ContentEditorWebPart();
    XmlDocument xmlDoc = new XmlDocument();
    XmlElement xmlElement = xmlDoc.CreateElement("HtmlContent");
    //xmlElement.InnerText = "<strong>Hello World!</strong>";
    //write the custom CSS style or JavaScript here
    string content = "<style>your custom style here...</style>";
    xmlElement.InnerText = content;
    webPart.Content = xmlElement;
    manager.AddWebPart(webPart, "Top", 0);
    manager.SaveChanges(webPart);
    web.Update();
    catch (Exception ex)
    //Utility.SPTraceLogError(ex);
    finally
    if (manager != null)
    manager.Dispose();
    web.AllowUnsafeUpdates = false;
    About how to hide fields on Standard List Forms using jQuery:
    http://social.technet.microsoft.com/wiki/contents/articles/21730.sharepoint-2010-conditionally-hide-fields-on-standard-list-forms-using-jquery.aspx
    http://stackoverflow.com/questions/10010405/how-to-hide-a-field-in-sharepoint-display-form-based-on-the-field-name-jquery
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Export and import views

    Hi all, I use Oracle 10.2.0 My OS is Win Server 2003. I used statement: exp userid=SYSTEM/xxx@MY_SCHEMA_X TABLES="My_List_Tables_On_My_Schema_X" FILE=MYDB.DMP OK, I exported success. But on MY_SCHEMA_X, I have some views, and now I want export again

  • How to find the patches for perticular concurrent program

    HI How to find the patches for perticular concurrent program. suppose for one concurrent program we create the patch and applied now i want know the which patch applied for perticular concurrent program through back end. Thank's

  • FWSM 4.0: switch from active/standby to active/active failover mode

    Hello, I have a pair of FWSM's running version 4.0 currently in active/standby failover mode, and I'd like to switch them to be active/active.  Is there a documented procedure for doing this?  What are the implications for any contexts switched to be

  • Could not create pool connection. the dbms driver exception was : null

    Hi, I am creating Data source to connect to my DB2 database Details of the connections are as follows 1) URL : jdbc:as400://hostname;translate binary=true 2) Driver class : com.ibm.as400.access.AS400JDBCDriver am getting following error when I am try

  • JMS library - where to get them ?

    Hello, we are using  MQ Series Version: 6.0.2.7 and want to use the SAP PI JMS Adapter. Where I can find the needed jar files to deploy ? Thanks, Gordon