Showing posts with label Hyper-V. Show all posts
Showing posts with label Hyper-V. Show all posts

Wednesday, March 8, 2017

Network Connection Folder Empty

Recently I had an issue with Server not displaying the Network Adapters.

 image

I checked and ping and it was okay.  But when I did a Failover Cluster Validation, it displayed error cause it couldn’t find the network.

The following are the steps that was carried out to have it resolve

  • Open regedit .
  • Drill to the following in the registry

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network

  • On the right-panel look for Config.  Delete the key.

    image
  • No worries.  When delete this key, it’s just removing the configuration cache.
  • Restart the server or just reopen the Control PanelNetwork, it will display once again.

    SNAGHTMLc1d9bb

keywords : Network Connection missing, network not display, network connections folder is empty, not showing network adapter list

Monday, February 27, 2017

How to remove “Unsupported Cluster Configuration” in SCVMM 2012

Recently I had a incident in one of the end user’s environment. 

The scenario is as follow :
The storage LUNs where the Virtual Machines resides had several Hard Disks failed.  There were not enough hotspare disks assigned to it.  The only way is to replace the faulty Hard Disks in the storage and then reconfigure it again.

Once it was done, the LUN was presented back to the Hosts and Failover Cluster recognize the LUN and then VMs were configured.

However, in the System Center Virtual Machine Manager (SCVMM 2012) has an issue.  It contained two identical records.  One is displayed as Running and another as Unsupported Cluster Configuration

image

Steps Taken

  • Ensure the VM is running in the Cluster
  • Launch the Virtual Machine Manager Command Shell in the Server that is running the SCVMM 2012
    (right-click run as administrator)
    image
  • Key in the command as follow in the VMM Command Shell that was launched :

    Get-SCVirtualMachine | where { $_.Name -EQ "Duplicate-ComputerName"} | fl name, status


    Note : Replace the Pink with your computer name that you want to remove from the SCVMM.   Remember the rest of the commands stay, including the quotes.
  •  It will display something like the screen below :

    SNAGHTMLb479c8
  • Next is to execute the command to  remove from the SCVMM database
    Get-SCVirtualMachine | where { $_.Name -EQ "Duplicate-ComputerName"} | Remove-SCVirtualMachine –Force

    Note : Replace the Pink with the computer name that you want to remove from the SCVMM.  The rest of the commands stays inclusive the quotes.  This is going to remove from the SCVMM DB but not removing the VM.  Remember the VM needs to be up and running.
  • In the SCVMM, the record will be removed and you need to do a refresh to once again get the information from the Cluster. 
    Right click on the Cluster in the VMM and click refresh

    image

After the SCVMM has completed the job (getting the information from the Cluster), the Unsupported Cluster Configuration is no longer in the record.  The one that is healthy is displayed in the cluster information.

A thank you to Aidan Finn and Law.

keywords : error 2604, unsupported cluster configuration, system center virtual machine manager, scvmm hyper-v, duplicate computer name in scvmm 2012, how to remove computer from scvmm 

Saturday, February 4, 2017

Cluster Disk in Failover Cluster Failed to Start (File Server)

Recently one of the customer had an upgrade in their firmware of their storage.  Their setup is as follow :

2 Hosts in Windows 2012 Server.  Using a shared storage and it’s setup with Windows 2012 Failover Cluster.

After both the hosts were rebooted, the Cluster Disk that was assigned as FileServer in the Failover Cluster failed to start.  From what I know it’s because both the hosts are assuming they are the owner of that particular Disk.  So both are locked to the resources.

SNAGHTML509baf5

I clicked on the “more details” to check it displayed as :

image

Further probing into the Disk Management and found that the Disk is in RAW. Before this it was in NTFS format.

image

Next I go into the shared Storage Management (which is the Dell Storage Manager in this scenario), tried to repair but in vain.  It displayed as follow :

SNAGHTML50f06bb

After going through the logs as earlier on, found that the resource was locked due to both the hosts are assume they are the rightful owner and both are trying to write at the same time.  In a Windows cluster environment, there’s only one owner at any one time.

Therefore I launched a PowerShell ISE in Administrator mode.

Execute a command to clear the Cluster Disk Reservation on both the hosts

image

In my scenario as above, in the Disk Management it shows as Disk 6, I execute the command of :

Clear-ClusterDiskReservation –disk 6

 Note : change only the one in Pink according to the info from disk management

Resource of the command : https://technet.microsoft.com/en-us/library/ee461016.aspx 

After that, I started the FileServer and no issue.  The format was in NTFS and content was intact.

In the Failover cluster of the File Server :

image

Hopefully this helps.

keywords : cluster disk reserve, error 219, dell storage manager, disk in RAW format, incorrect function, cannot start up cluster disk file server, the requested resource is in use, persistent reservation

Wednesday, July 27, 2016

Hyper-V VSS Writer State : [7] Failed Last error : Timed out

Had an issue of the Hyper-V VSS when I typed to check.

vssadmin list writers

image

In the event viewer I got as the following :

SNAGHTMLd65090\

I want to get the VSS back to be stabilize but not wanting to restart the server, therefore I restart a service.

image

Service to restart : Microsoft Virtual Machine Management

Keyword :

Volume Shadow Copy Service error: Unexpected error querying for the IVssWriterCallback interface. hr = 0x80070005, Access is denied.. This is often caused by incorrect security settings in either the writer or requestor process.Operation:  Gathering Writer Data Context:  Writer Class Id: {e8132975-6f93-4464-a53e-1050253ae220}  Writer Name: System Writer  Writer Instance ID: {bc497fa6-6627-47fb-a005-ac94fa83904e}Error : 8194 vssadmin list writer Hyper-V State 7 timed out

Tuesday, June 28, 2016

PowerShell–Get-VM command is not recognize or missing

Currently I’m supporting one of the customer, found out that the PowerShell is in version 1.0 in the SCVMM.  Therefore, I tried to execute a script using the get-vm but it says as not recognize.

The message was :

PS C:\Users\Administrator\Desktop> Get-VM
The term 'Get-VM' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
As a workaround, I’ve execute the command as below :

Import-Module virtualmachinemanager

Then the get-vm command works.

keywords : SCVMM, get-vm missing, get-vm command not recognize, powershell command not recognize.

Thursday, May 26, 2016

Reset Local Administrator Password for Azure VM

Recently I had set up quite a couple of VMs in Azure and one of the VMs local administrator’s password I’ve keyed in wrongly and totally forgotten what is it anymore.

So in the Azure new portal there’s a feature to reset the password.

Local Administrator username : bkhoo

The steps taken are as below :

    image

    • On the left menu bar click on the Virtual Machines
    • In the Virtual Machines, select the specific Virtual Machine that want to reset the local administrator password.

    image

    • In the settings menu on the right, click Reset password .

    image

    • Key in the new password and confirm password, then click on Reset 

    Then I test it, I can now RDP into the VM using the new reset password .

    keywords : forgot password,local administrator password, Azure VM, Virtual machine password, how to reset local administrator password in virtual machine, VM, VMs, virtual machines

    Monday, April 4, 2016

    Killing a Hung VM in Task Manager (Another PowerShell command)

    This is another command of how to kill a Hung VM by identify the Process ID using PowerShell command :

    image

    For Windows 2012

    Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto

    For Window 2012 R2

    Get-WmiObject -Namespace root\virtualization\v2 -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto

    Once the Process ID is obtain, launch the Task Manager and kill the VMWP.exe process with the correspondence Process  ID to that particular VM.

    image

    Hope this helps.

    keywords : hang VM, hung VM, stuck VM, Hyper-V virtualization stuck Server 2012 R2, vmwp.exe, killing vwmp.exe

    Killing a Hung VM in Task Manager

    Sometimes the VM we tried to stop hangs.  So in order to kill the process using the Task Manager, we can end process of VMWP.exe.  But the next question is which one.  Each VM has a unique Process ID.

    image

    Therefore, I launch the elevated Powershell by executing the following command below

    Get-WmiObject win32_process -Filter "Name like '%vmwp%'" | Select-Object ProcessID, @{Label="VMName";expression={(Get-VM -Id $_.commandline.split("")[1]|Select-Object VMName).VMName}}|ft –AutoSize

    image

    So I go back to the Task Manager and Right-Click on it and end task,base on the Process ID of that particular VM.

    image

    Hope this command helps you as it helped me.

    keywords : hang VM, hung VM, stuck VM, Hyper-V virtualization stuck Server 2012 R2, vmwp.exe, killing vwmp.exe

    Friday, March 11, 2016

    DPM 2012 Reporting Issue (ID : 220)

    After upgrading from SCDPM 2012 SP1 to SCDPM 2012 R2, I hit the issue when I tried to configure the Reporting to be send out periodically in the Report Module of SCDPM 2012 R2.

    image

    The steps taken was the following :

    • Launch the Reporting Services Manager (in my example is SQL 2008 R2, since it’s upgraded gradually from SCDPM 2012 SP1 to SCDPM 2012 R2)
    • Ensure to the correct database that I’m pointing to  (e.g. MSDPM2012)
    • Navigate to E-Mail Settings.
    • Key in the valid Sender Address and SMTP Server.
    • Click Apply

    SNAGHTML5532c4a

    • Launch the SCDPM 2012 R2 – Reporting
    • Configure the schedule reporting with emails, tested with no issues.keywords : SCDPM 2012, DPM cannot enable e-mail subscription for reports unless SMTP details are configured in the remote SQL Server Reporting Service Installation. SMTP details need to be configured manually when an existing SQL Server is chosen to be used for DPM during DPM setup.  Please enter the SMTP server name, SMTP port number and SMTP From address manually in the SQL Server Reporting Services configuration File.
      Configuration file path : c:\Program Files\Microsoft DPM\SQL\MSRS10.MSDPM2010\Reporting Services\ReportServer\RSReportServer.config
      The SMTP Server  details on the SMTP Servers tab in the Options dialog enables only DPM alert notifications. For more details, see DPM Help (ID : 220)
      SCDPM Report error, Systems Center Data Protection Manager Report Error, cannot configure email distribution in DPM report

    Thursday, August 13, 2015

    Azure Recovery Services–backup increased to 54TB limit

    Earlier last month I shared on how to configure the DPM 2012 R2 with Azure Recovery (Backup Vault)

    Microsoft Azure recovery Services team has officially released the backup per protection group from 1.7TB limit and now to 54TB limit on 12th Aug 2015.

    You need to have the Azure Recovery Services Agent 2.0.8715.0 or higher in order for the backup to exceed the limitation of 1.7TB.

    image

    The news release is here.

    keynote : Azure limit, ASR, Azure Recovery Services, DPM, SCDPM, storage limit.backup limit

    Friday, July 31, 2015

    Class 20409B - Server Virtualization with Windows Server Hyper-V and System Center

     

    Just finished conducting a 5-days class on Server Virtualization using Hyper-V and System Center.  During class, I shared real life scenarios on how it was implemented, what are the obstacles they will face if planning were not done properly in the first place before rolling out.

    Feeling happy that the students went back with knowledge.

    keywords : 20409, Hyper-V, virtualization, backup, protection, VMM, virtual machine manager, dpm, azure, cloud, vmmlibrary,

    Wednesday, July 29, 2015

    System Center Virtual Labs

     

    Let’s get our hands ‘dirty’ and I want to share the “Virtual Labs” that I found especially lots and lots of Systems Center labs.

    image

    The Website is in this link.

    Let’s get started !!

     

    keywords : systems center, virtualization, virtual, hyper-v, virtual machine, data protection, monitoring, SCOM, SCCM, Service Manager

    Wednesday, July 22, 2015

    Upgrade Windows Server 2012 R2 Evaluation Version to License/ Full Version

    I had been doing a development or lab environment with Windows 2012 R2 Datacenter Evaluation copy.  Lots of work has been done.

    Instead of reinstalling the entire copy of a Windows Server 2012 R2 Full Version and then reinstalling the application that I’ve been doing lots of work on it, I found a way to upgrade the Windows Server 2012 R2 Evaluation to a Full Windows Server 2012 R2.

    (Note : This does not work for Domain Controllers running on evaluation license)

    The following are the steps that I want to share.

    image

    The above shows the desktop of the Windows 2012 R2 that I’ve been testing and the 180 days is over.  I can do the slmgr.vbs –rearm , however had decided to go a full version and put into production since testing has been done for the application installed in this server.

    image

    Using the command slmgr.vbs /dlv would gather the information for the volume licensing.

    image

    As the arrow shows the information is an evaluation Windows Server 2012 copy.

    Another way is to launch the command prompt in elavated (run as administrator).

    Key in the command as below in the command prompt.

    dism /online /get-currentedition

    image

    As you see, it shows the Current Edition is an Evaluation copy.

    Next command is to check what version this current Evaluation can be upgrade to.

    dism /online /get-targeteditions

    image

    If the evaluation copy is a ServerStandard, it will allow the option to upgrade to Standard Full or Datacenter Full edition

    Next get the full license key ready. The next command will need to input in the command.  The command is as :

    For DataCenter Edition key in as below :

    dism /online /set-edition:ServerDataCenter /ProductKey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /AcceptEula

    For ServerStandard Edition key in as below :

    dism /online /set-edition:ServerStandard /ProductKey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /AcceptEula

    Only make the changes in the Pink colour (input your valid license key).  In my example I’m using the DataCenter edition.

    SNAGHTML2f84ac

    It will look something like the above displayed.  Press enter to execute.

    image

    Press Y to restart the computer

    image

    image

    The computer will restart/reboot twice.

    Once it’s done, login the Windows and you’ll have the full version of the Windows 2012 R2

    image

    Reference : Evaluation Versions and Upgrade Options for Windows Server 2012

    keywords : upgrade evaluation to full copy, windows 2012 R2, Windows 2012 server, upgrade eval, full license, server 2012 eval, slmgr, rearm

    Monday, January 19, 2015

    PowerShell to Retrieve OS Image family from Azure

    Azure is an ever changing.  At times I have PowerShell that provision certain image from the Azure Library, but the naming of the image keeps changing.

    Once the Azure account is established to the local server PowerShell, I would use the script below to retrieve example all Windows 2012 family in Azure.

    $osimage = (Get-AzureVMImage | where {$_.ImageFamily -like "Windows Server 2012 *"} | sort PublishedDate -Descending)[0].ImageName

    Once that’s done, I’ll just display by key in

    $osimage

    End result looks like this :

    image

    Thank you and hopes this helps.

    keynote : OS Deployment from Azure, OS Image, osimage from Azure, Azure, Windows 2012 from Azure, Image from Azure

    Wednesday, December 17, 2014

    How to Write into Event Viewer (using PowerShell)

    I’m into a situation that I want to write the activity that was carried out into the Event Viewer (say the Application).

    I’ve a PowerShell script but has incorporated the following in the beginning and the end of the script.

    First I need to register the event into the server’s event viewer.  I call it as “InFront Maintenance”

    In the PowerShell, I only execute once to record it down.

    New-EventLog –LogName Application –Source “InFront Maintenance

    Once it’s registered, then I incorporated the following into my beginning of my script the activity that I need to carry out. 

    Note : If you do not register, the next line you execute to write to event viewer, you’ll definitely hit the error.  This is because the “SOURCE” is not registered.

    Write-EventLog –LogName Application –Source “InFront Maintenance” –EntryType Information –EventID 1 –Message “Maintenance Spoke A.

    So in the event viewer you’ll be able to see something like this

    image

    At the end of my script I indicate as follow :

    Write-EventLog –LogName Application –Source “InFront Maintenance” –EntryType Information –EventID 1 –Message “End Maintenance Spoke A

    In the event viewer you’ll see like this :

    image

    So to summary it :

    To register for the first time the event (just once)

    • New-EventLog –LogName Application –Source “InFront Maintenance

    Insert beginning on my PowerShell Script

    • Write-EventLog –LogName Application –Source “InFront Maintenance” –EntryType Information –EventID 1 –Message “Maintenance Spoke A.

    Insert at the end of my PowerShell Script

    • Write-EventLog –LogName Application –Source “InFront Maintenance” –EntryType Information –EventID 1 –Message “End Maintenance Spoke A

    Just change the Pink for your event, and the Yellow for the General Descriptions.

    Thanks to the Scripting Guy Site , Ed Wilson!!

    keynote : How to write to Event Viewer with powershell, using powershell to write event,event log, application log event viewer, eventviewer with PowerShell, record activity into event viewer

    Friday, December 12, 2014

    Drag and Drop Files into VM

    I’ve a Windows 2012 R2 running Hyper-V.  A VM is running inside this Hyper-V but I need to copy some of the files into the VM.  One of the reason for not connecting to network is that the VM is cloned and I do not want to clash with the Production VM.

    There’s a way that you can Drag and Drop into the VM from the Hyper-V Host into the VM.

    Open the Hyper-V Settings – Click on the Enhanced Session Mode Policy.

    Mark a check in the “Allow enhanced session mode” and click OK.

    SNAGHTML64b88ea

    Once that is done, you can drag from your Hyper-V Host into the VM desktop or any folder that you want to copy into the VM.

    Thank you and hope that helps.

    keyword : drag and drop files, folders into VM that is not connected to network in Hyper-V host.

    Thursday, December 11, 2014

    Extending VHD / VHDX Volume

    I have prepared the VHDX (or VHD in some cases) and it’s SYSPREP.  Now my C Drive is only 60GB but I would like to extend the hard disk to 100GB, to enable for me to install other applications on the C Drive.

    I’m going to share how I do it.

    My VHD is in the external drive (USB connected Hard Drive). 

    Location E:\VHD\Demo

    The VHD File is WIN81-ENT-x64-SYSPREP1.vhdx

    image

    I mount the drive to check on the space

    image

    As you can see it’s about 60GB. I’ll unmount and show the steps using DISKPART command

    The command as follow :

    • Open Command Prompt with Administrator rights
    • Key in DISKPART
    • Next key in Select the Disk of where your VHD is located. For me is located at E Drive.  Therefore I key in as select vdisk file=”E:\VHD\Demo\WIN81-Ent-x64-SYSPREP.vhdx” 
    • Next to expand the TOTAL size of the VHD. I key in as expand vdisk maximum=100000
    • Next key in attach vdisk
    • Then key in list disk to view. If it’s not online then key on ONLINE DISK. It should be online automatically.

    image

    • Next key in list volume
    • As you can see the volume shows as still 60GB
    • I key in as select volume 6
    • Key in extend
    • Key in list volume to see the new size

    image

    • Opening up the attach disk, now it’s close to 100GB

    image

    Now I’m done, I would like to detach the VHD

    Back to the DISKPART command prompt

    • Key in detach vdisk
    • Key in exit to quit diskpart from command prompt

    image

    In summary, I’ve keyed in as follow :

    • DISKPART
    • select vdisk file=”E:\VHD\Demo\WIN81-Ent-x64-SYSPREP.vhdx 
    • expand vdisk maximum=100000
    • attach vdisk
    • list disk
    • list volume
    • select volume 6
    • extend
    • list volume 
    • detach vdisk
    • exit 

    Command in diskpart is in GREEN, you change those values in PINK 

    Hopefully the steps are helpful.

    keywords : diskpart, extend vhdx, extend vhd, expand volume size

    Monday, April 7, 2014

    How to check Disk Space Usage and Free Space Remotely using PowerShell

    Scenario :

    Two hyper-V Host (clustered) with multiple VMs in it.  I need to check on the disk allocation, disk space usage & disk free space.  With the script below I’m going to share how I did it using PowerShell.  I just run it in one of the Hyper-V Hosts PowerShell.

    [Special credit to StackOverflow and BinaryNature.  I’ve made changes to ease the entry of variables]

    The credential used in the script must be part of the local administrators group

    # ----- Beginning of Script -----

    #Define ServerName (Physical/VM) Here

    # Change the Variables in PINK and remark out with # if the server or VM is not needed

    $PHY1="SVR1"
    $PHY2="SVR2"
    $AD1="ADVM1"
    $APP1="APPVM1"
    # $APP2="APPVM2"
    $DB1="DBVM1"
    $DP1="DPVM1"
    $DPM1="DPMVM1"
    $DomainUser = "domain\user1"

    # Diskfree Module

    function Get-DiskFree
    {
        [CmdletBinding()]
        param
        (
            [Parameter(Position=0,
                       ValueFromPipeline=$true,
                       ValueFromPipelineByPropertyName=$true)]
            [Alias('hostname')]
            [Alias('cn')]
            [string[]]$ComputerName = $env:COMPUTERNAME,
         
            [Parameter(Position=1,
                       Mandatory=$false)]
            [Alias('runas')]
            [System.Management.Automation.Credential()]$Credential =
            [System.Management.Automation.PSCredential]::Empty,
         
            [Parameter(Position=2)]
            [switch]$Format
        )
     
        BEGIN
        {
            function Format-HumanReadable
            {
                param ($size)
                switch ($size)
                {
                    {$_ -ge 1PB}{"{0:#.#'P'}" -f ($size / 1PB); break}
                    {$_ -ge 1TB}{"{0:#.#'T'}" -f ($size / 1TB); break}
                    {$_ -ge 1GB}{"{0:#.#'G'}" -f ($size / 1GB); break}
                    {$_ -ge 1MB}{"{0:#.#'M'}" -f ($size / 1MB); break}
                    {$_ -ge 1KB}{"{0:#'K'}" -f ($size / 1KB); break}
                    default {"{0}" -f ($size) + "B"}
                }
            }
         
            $wmiq = 'SELECT * FROM Win32_LogicalDisk WHERE Size != Null AND DriveType >= 2'
        }
     
        PROCESS
        {
            foreach ($computer in $ComputerName)
            {
                try
                {
                    if ($computer -eq $env:COMPUTERNAME)
                    {
                        $disks = Get-WmiObject -Query $wmiq `
                                 -ComputerName $computer -ErrorAction Stop
                    }
                    else
                    {
                        $disks = Get-WmiObject -Query $wmiq `
                                 -ComputerName $computer -Credential $Credential `
                                 -ErrorAction Stop
                    }
                 
                    if ($Format)
                    {
                        # Create array for $disk objects and then populate
                        $diskarray = @()
                        $disks | ForEach-Object { $diskarray += $_ }
                     
                        $diskarray | Select-Object @{n='Name';e={$_.SystemName}},
                            @{n='Vol';e={$_.DeviceID}},
                            @{n='Size';e={Format-HumanReadable $_.Size}},
                            @{n='Used';e={Format-HumanReadable `
                            (($_.Size)-($_.FreeSpace))}},
                            @{n='Avail';e={Format-HumanReadable $_.FreeSpace}},
                            @{n='Use%';e={[int](((($_.Size)-($_.FreeSpace))`
                            /($_.Size) * 100))}},
                            @{n='FS';e={$_.FileSystem}},
                            @{n='Type';e={$_.Description}}
                    }
                    else
                    {
                        foreach ($disk in $disks)
                        {
                            $diskprops = @{'Volume'=$disk.DeviceID;
                                       'Size'=$disk.Size;
                                       'Used'=($disk.Size - $disk.FreeSpace);
                                       'Available'=$disk.FreeSpace;
                                       'FileSystem'=$disk.FileSystem;
                                       'Type'=$disk.Description
                                       'Computer'=$disk.SystemName;}
                     
                            # Create custom PS object and apply type
                            $diskobj = New-Object -TypeName PSObject `
                                       -Property $diskprops
                            $diskobj.PSObject.TypeNames.Insert(0,'BinaryNature.DiskFree')
                     
                            Write-Output $diskobj
                        }
                    }
                }
                catch
                {
                    # Check for common DCOM errors and display "friendly" output
                    switch ($_)
                    {
                        { $_.Exception.ErrorCode -eq 0x800706ba } `
                            { $err = 'Unavailable (Host Offline or Firewall)';
                                break; }
                        { $_.CategoryInfo.Reason -eq 'UnauthorizedAccessException' } `
                            { $err = 'Access denied (Check User Permissions)';
                                break; }
                        default { $err = $_.Exception.Message }
                    }
                    Write-Warning "$computer - $err"
                }
            }
        }
     
        END {}
    }


    $cred = Get-Credential -Credential $DomainUser
    $PHY1, PHY2, $AD, $APP1, $APP2, $DB1, $DP1, $DPM1 | Get-DiskFree -Credential $cred -Format | Format-Table -GroupBy Name -AutoSize


    # ----- End of Script -----

    Steps

    My method was copy the script above (from Beginning to End of the Script)  into a notepad and make changes only to the PINK.  Please include the “ “ quotes as in the scripts. 

    (You can also save it as powershell script with ext of PS1 and run. Since this is a one time, I don’t intend to save it as PS1 file)

    After making the necessary changes, I copied the text and launch the PowerShell (need to run as Administrator) from one of the Hosts

    image

    …then I paste into the PowerShell screen and press [Enter]

    image

    It will display the credential, key in the password :

    image

    It will display something like below with the (servername or VM name as I’ve hide) :

    image

    Happy trying  and hope the script helps as it helps me.

    keywords : checking free space with powershell, powershell scripts, power shell script, checking space usage remotely, windows 2012 check disk space in VM