Posts tagged with PowerShell

Unmapping Network Drives

June 27th, 2015 by and tagged , , , , ,

Unmapping network drives with PowerShell should be easy, and it is, but with some caveats. If you always create your network drive mappings with New-PSDrive, then it’s easy to unmap them with Remove-PSDrive. But if some of them are created with Group Policy, some of them with the legacy “net use” commands, some of them […]

Posted in PowerShell, WMI | 4 Comments »

Finally, the death of CMD!

February 2nd, 2015 by and tagged , ,

Well, OK, it’s still there in Windows 10 But finally, completely, I no longer need it for ANYTHING! The final piece that I still used is now available in PowerShell v5. The latest publicly available Preview Build of Windows 10 Technical Preview (build 9926), includes updates to New-Item to support Junctions and Hard Links. Finally! […]

Posted in Network Administration, PowerShell, Windows Server | 2 Comments »

Finding out what RAM DIMMs are installed on a computer without opening the box

September 9th, 2014 by and tagged , , , ,

OK, so I needed to know exactly what RAM was installed on a computer and how many slots there were. I could have had the user shutdown his machine, opened up the box, got out a flashlight, popped out the DIMMs, written down the obscure part numbers, plugged them back in, and closed it up. […]

Posted in Hardware, PowerShell, WMI | Comments Off on Finding out what RAM DIMMs are installed on a computer without opening the box

Getting the IP addresses of running VMs

April 23rd, 2014 by and tagged , ,

  Ben Armstrong posted a great little tip on his blog the other day. He has a little one-line PowerShell command that gives you a listing of all the running VMs on a host, and the IP addresses being used by each of them. Get-VM | ?{$_.State -eq “Running”}   Get-VMNetworkAdapter | Select VMName, IPAddresses […]

Posted in Hyper-V, PowerShell | Comments Off on Getting the IP addresses of running VMs

Shutting Down Running VMs

February 24th, 2014 by and tagged , ,

A quick Hyper-V PowerShell one-liner today. This one will gracefully stop all virtual machines with RODC in their name.  Get-VM -Name *rodc* | Where-Object {$_.State -eq “Running” } | Foreach-Object { Stop-VM $_.Name } I needed this because I was cloning an RODC that I had virtualized, and I wanted a quick way to shut […]

Posted in Active Directory, Hyper-V, PowerShell | Comments Off on Shutting Down Running VMs

Set Network Location to Private in Windows 8 & 10 and Windows Server 2012 & 2016

December 29th, 2013 by and tagged , , , , ,

One of those annoyances that sometimes happen with the new Network Location in Windows 8.x and Windows 10 is that the network gets mis-identified as Public when it should be Private, or the other way around. Changing this in the GUI is certainly possible, but annoying, so let’s take advantage of the improved Windows PowerShell […]

Posted in Network Administration, PowerShell, Windows 10, Windows Server 2016 | 20 Comments »

Getting Drive Information Using WMI and PowerShell

June 15th, 2013 by and tagged , , ,

In my ongoing quest to remove dependency on legacy DOS commands, I recently created this script to get a list of all the local and mapped drives on a machine and how much free space each has on it.  This script could be easily extended to display additional information (such as the underlying filesystem type) […]

Posted in PowerShell, WMI | 1 Comment »

Windows Azure PowerShell

August 7th, 2012 by and tagged ,

For those of you using Windows Azure, we finally have official PowerShell support for managing your Azure subscriptions. With the CTP release of the 1.7 SDK, you can install the Windows Azure PowerShell cmdlets. The download is here.   Keep in mind that this is a CTP, and the first version of the cmdlets released,  […]

Posted in PowerShell, Windows Azure | Comments Off on Windows Azure PowerShell

PowerShell v3 – Using PSDrive to Replace Net Use

August 1st, 2012 by and tagged , ,

I routinely have to map drives across domain boundaries, or to/from non-domain and domain machines. In the old days, I used NET USE commands, which were OK, but there were some issues. Besides, it’s time to move to away from legacy commands such as NET. PowerShell v3 includes an updated set of PSDrive cmdlets (Get, […]

Posted in $Profile, PowerShell, WMI | Comments Off on PowerShell v3 – Using PSDrive to Replace Net Use

Mapping Drives

January 3rd, 2012 by and tagged , ,

My standard environment expects to have several drive mappings wherever I’m logged in to my network. Even when I’m running on a computer that isn’t joined to the domain. To facilitate that, I have a simple “mapdrives.cmd” file that has the necessary net use commands in it to map them.  Then my default PowerShell $profile […]

Posted in PowerShell | Comments Off on Mapping Drives

« Previous Entries Next Entries »