Creating a Storage Space in Windows 10 with Powershell

I’m not sure if this is due to system in question being in the insider fast ring (Build 19041 version 10.0.19041), however when trying to create a storage space via the GUI I got the following error: Can’t prepare drives Close all applications that are accessing the drive and then try again. ‪The parameter is incorrect. (0x00000057)‬ You have to make sure the disks are clear of partitions otherwise they will not even appear in the create storage pool wizard.
Read more →

Searching for a DHCP Lease by MAC Address in Active Directory Forest

In a previous post (3 years 4 months 2 days ago) I wrote about searching DHCP leases directly on a DHCP server which was rather limiting especially if you are in larger network. These days I use the following script from a management desktop running RSAT which automatically lists authorised DHCP servers in the forest and searches though all scopes: $AllDhcpServers = Get-DhcpServerInDC $result = @( @($AllDhcpServers).foreach({ @(Get-DhcpServerv4Scope -ComputerName $.DnsName | Get-DhcpServerv4Lease -ComputerName $.
Read more →

Searching for a DHCP Lease by MAC Address

Update Note, if you are looking to search for DHCP information across all or multiple DHCP servers in the forest then this is a quicker method. The below is still valid if you are searching a single server. Sometimes in a large infrastructure it can be hard to find new devices added to the network. Being able to search on MAC address across all DHCP scopes comes in handy. With powershell and Windows DHCP server this is easy to do.
Read more →

Finding the Exchange Mail Pickup and Replay Directory Folder Location in Your Exchange Infrastructure

Use the following powershell command to return the mail pickup folder location from all your Edge and Hub Transport servers. Get-TransportServer | Fl name, PickupDirectoryPath If you are interested in a single server add -Identity: Get-TransportServer -Identity "Server Name" | Fl name, PickupDirectoryPath Where “Server Name” is the Exchange box you are interested in.
Read more →

Bulk Removing Zone.Identifier Alternate Data Streams From Downloaded Windows Files

Alternate Data Streams (ADS) are used by Windows to add an identifier describing the ‘internet explorer zone’ the file was downloaded from. If the zone was not trusted you may have to unblock the file. Certain file types are more at risky and therefore are automatically blocked (see here). To manually unblock the file go to explorer and right click the file, select properties and click unblock. This is somewhat cumbersome for large numbers of files.
Read more →

Listing System Center Configuration Manager Inbox Folders with Powershell

It is a good idea to keep track of these folders as they can get out of control quite quickly. This powershell command quickly highlights if you have any build up going on. Look out for large numbers of files: Get-ChildItem “c:\Program Files\Microsoft Configuration Manager\inboxes” -recurse | Where {!$_.PSIsContainer} | Group Directory | Format-Table Name, Count -autosize
Read more →