I mentioned in a previous post that we were experimenting with Azure Virtual Desktop. One of the things that I need to be able to do is launch from a web page. We have figured out how to do that using this info: Uniform Resource Identifier schemes with the Remote Desktop client for Azure Virtual… Continue reading Further AVD Adventures
Category: Scripting
Pull DHCP info using PowerShell
This short script will get all the DHCP servers authorized in your Windows domain, and pull all the scopes and IPs. It exports these to two separate CSV files. $DHCPServers = Get-DhcpServerInDC If (Test-Path -Path $env:TEMP\Scopes.csv) {Remove-Item $env:TEMP\Scopes.csv} If (Test-Path -Path $env:TEMP\Leases.csv) {Remove-Item $env:TEMP\Leases.csv} If (Test-Path -Path $env:TEMP\Leases.csv) {Remove-Item $env:TEMP\DNSExport.csv} foreach ($_ In $DHCPServers) {… Continue reading Pull DHCP info using PowerShell
DNS PowerShell one liner
This is a “one liner” that pulls all the DNS Entries for a particular zone, including the IPv4 and IPv6. If you don’t care about the IPv6, you can remove that segment of the code. Get-DnsServerResourceRecord –ComputerName <DNSServerName> –ZoneName <YourZoneName> | Select-Object DistinguishedName,HostName,@{Name=’IPv4Address’;Expression={$_.RecordData.IPv4Address.IPAddressToString}},@{Name=’IPv6Address’;Expression={$_.RecordData.IPv6Address.IPAddressToString}},RecordType,Timestamp,TimeToLive | Export-Csv $env:TEMP\DNSExport.csv –NoTypeInformation It is amazing how much you can do… Continue reading DNS PowerShell one liner
Express Route Provisioning Error
We have recently decided to invest in an Express Route circuit for Azure. It is supposed to be helpful with Azure and Office 365. There are two ways to provision the ExpressRoute circuit. Both require PowerShell. There is the classic: https://azure.microsoft.com/en-us/documentation/articles/expressroute-howto-circuit-classic/ And there is the Resource Manager: https://azure.microsoft.com/en-us/documentation/articles/expressroute-howto-circuit-arm/ Here is the note about those… Continue reading Express Route Provisioning Error
SharePoint Documents are all checked out
I wanted to write a PowerShell script to check all the documents back in that had been checked out. Turns out that is not as straight forward as I had hoped. First search came up with this: Office Discarding Check Out Using PowerShell Then when I tried to run the command (from the server console,… Continue reading SharePoint Documents are all checked out
Operations Manager 2012 R2 Management Pack Dependencies
I am not proficient at managing Ops Manager. I am at best a competent tinkerer. I have been needing to do some clean up on our Ops Manager installation, and clear some management packs that are not used, or just used to generate noise that we subsequently ignore. That is a bit of an annoying… Continue reading Operations Manager 2012 R2 Management Pack Dependencies
Script to fix “unknown” power state in Xen Desktop
After an unpretty Hyper-V cluster failover, several machines in our Xen Desktop deployment were showing an “unknown” power state. After a call to Citrix, they gave my coworker a few commands to use to fix it. This has to be done from the Xen Desktop controller: Load the Citrix PSSnapIn: Add-PSSnapIn Citrix.* This gets… Continue reading Script to fix “unknown” power state in Xen Desktop
Import .msg files into Outlook using Powershell
We have some old email database backup files that we extracted messages from. The purpose of this was to be able to expire the backups and do away with them, while keeping the messages in our Journal for e-discovery purposes. There are better ways to do what we did, than the way we did this,… Continue reading Import .msg files into Outlook using Powershell
Launch a PowerShell script minimized
We use Citrix for a lot of applications, and I have a need to launch Outlook, then an application, and then close Outlook when that application is closed by the user. This seems like a pretty simple thing to do (and I suppose it is, sort of) but it took me a while to figure… Continue reading Launch a PowerShell script minimized
Using Powershell to get logon script path from Active Directory
If you want to know what logon script users are getting, this is an easy way to get that information: Import-Module -Name ActiveDirectory Get-ADUser -Filter * -SearchBase "OU=YourOUName,DC=YourDomain,DC=COM" -properties ScriptPath | Export-Csv "c:\script\ADUser.csv" Note: In order for this to work, you have to have the ActiveDirectory Module loaded.