Browsed by
Tag: powershell

Find devices attached to Office 365 mail accounts

Find devices attached to Office 365 mail accounts

I was recently asked if there was a way to see a list of users who had mobile devices attached to their Office 365 account.  In order to do this I have written a PowerShell script.  The script is generic only relies on you having global admin access to Office 365. Built into my script is the commands that prompts for your Office 365 admin credentials and connects your PowerShell session to your tenant. The script builds and output file…

Read More Read More

August User Groups in Scotland

August User Groups in Scotland

There are quite a lot of good events and user groups happening in Scotland next month and I thought it would be good to share the details of these.   Glasgow SQL Server Meetup The Glasgow based SQL server meetup group will be meeting up in Glasgow City Centre on the 22nd August and will have some talks from local professionals. Scottish PowerShell User Group This new user group will be holding their meet on the 22nd of August also,…

Read More Read More

Clean up Azure Resource Groups with PowerShell

Clean up Azure Resource Groups with PowerShell

I have an Azure subscription that I use for test/dev purposes and it was starting to get a little crowded the other day with various labs that I had spun up for a purpose and never removed.  So I had a wee spring clean using some handy PowerShell commands. I covered some basic commands on how to connect to your Azure subscription via PowerShell within my  “Connecting to Azure with PowerShell and controlling your VMs” blog post. Connect to Azure…

Read More Read More

Upcoming Scottish User Groups

Upcoming Scottish User Groups

Recently I’ve been on the hunt for some user groups to attend and have managed to find a few that look interesting.  I thought I would share the ones I’ve found to help my fellow Scottish IT professionals join in with the community and hopefully learn something along the way.   Edinburgh SQL Server User Group Meeting This SQL user group is meeting in Edinburgh City Centre on the 16th of March.  The topics scheduled to be discussed are based…

Read More Read More

How To Configure DHCP Using Powershell

How To Configure DHCP Using Powershell

I have complied some notes on how to install and configure DHCP using Powershell cmdlets.  These can come in handy for setting up lab environments quickly or scripting changes within your environment easily. The first cmdlet is how to install the necessary role: Once the DHCP role has been created you can start to configure scopes and various options needed for that scope. The cmdlet below creates a scope with the range 10.10.54.3-254, it sets the subnet to 255.255.255.0. And…

Read More Read More

Enable Telnet with Powershell

Enable Telnet with Powershell

Every now and again you need to troubleshoot firewall rules and Telnet is a great tool to help understand if a port is open or not between two devices.  However Telnet is not enabled by default anymore, it has been like that since Windows Server 2008. The following Powershell commands will help you to quickly enable it: Installing the Telnet client doesn’t require a reboot.   The client can also be removed easily via Powershell with these commands: Please follow…

Read More Read More

Configure non-integrated DNS zones with Powershell

Configure non-integrated DNS zones with Powershell

I’ve been looking at scripting out the build out of my Azure Lab so I can build it, use it for a purpose then rip it down and start again to use it again.  One of the scripts that I’ve pulled together is configuring non-integrated DNS Zones with Powershell both on a local server and a remote server. The script I’ve created assumes that the DNS role is installed on your servers and that PSRemoting is enabled on your servers. …

Read More Read More

How to Run PowerShell Commands on Remote Computers

How to Run PowerShell Commands on Remote Computers

Powershell Remoting can allow you to run individual commands or run full Powershell sessions on remote systems.  Unfortunately by default it is locked down, so before you try to use it you need to enable it.  Within a domain this is an easy process. On the computer you wish to remote to open up a Powershell command as Administrator. Run the following cmdlet:   This command will start the WinRM service and sets it to automatic, it also creates a…

Read More Read More

Configuring Zone Transfers using DNSCMD

Configuring Zone Transfers using DNSCMD

While setting up a lab within Azure I’ve done some work on DNS and how to script parts of during setup and apply changes after setup. Although DNSCMD is marked as a something Microsoft might remove in future versions of Windows I’ve been using it to make some changes within my environment. In my examples below I’ve used “azurelab.com” as my zone name, please replace accordingly for your use. The following command will allow zone transfers to happen to any…

Read More Read More