How to copy old user’s mailbox to another user’s mailbox on Office 365 and Exchange Server using PowerShell

You will come across the issue with leavers mailboxes needing to be transferred to another users mailbox. If you are looking after on-site exchange, then the process is slightly shorter as you don’t need to connect to the remote Powershell.   To connect to O365 first run this PS command: $Cred = Get-Credential  $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic […]

Read more

Bulk import email aliases to Office 365 using Powershell

If you need to add email aliases to O365 accts in bulk use the following (EMS) powershell command with the CSV file formatted this way:   Name ProxyAddresses user1@domainold.com user1@domainnew.com   Run this in EMS: Import-Csv C:\email-aliases.csv | ForEach-Object{ $name = $_.Name }  Import-Csv C:\email-aliases.csv | ForEach-Object{ $proxy = $_.ProxyAddresses -split ‘;’}  Set-RemoteMailbox -Identity $name -EmailAddresses @{add= $proxy}    OR   Get the display name and email […]

Read more

How to Add Computers to a Domain Using PowerShell

Performing a Domain Join Using PowerShell Once you’ve established correct DNS resolution for the domain name, start a PowerShell prompt with local administrative privileges. Press the Windows key to switch to the Start menu, type PowerShell and press CTRL+SHIFT+ENTER. If prompted, enter a local administrator username and password, or give consent to run PowerShell. In the PowerShell prompt, type add-computer –domainname ad.contoso.com -Credential AD\adminuser […]

Read more

How to Get the Serial Number of a Remote Computer Using PowerShell

Retrieving the Serial Number from a Local Computer The get-ciminstance PowerShell command was introduced in PowerShell 3.0. It allows administrators to run WMI queries on local or remote computers. To retrieve the BIOS serial number of the local computer, we need to access the Win32_BIOSWMI class. Log on to Windows Server 2012 R2, click the PowerShell icon on the desktop taskbar. In the prompt window, […]

Read more

Recovering Deleted Email with New Exchange Online Cmdlets

Exchange Makes It Easy for Users to Fix Deletion Mistakes Exchange has used a two-step item deletion process for nearly 20 years. When someone deletes an item from a mailbox, it moves into the Deleted Items folder. Later, when the user empties the Deleted Items folder, or the Managed Folder Assistant empties the folder under the instruction of a retention […]

Read more

How to Automate Software Package Installations in Server 2016 via PowerShell

Here are some of the ways you can automate software package and modules installations in Server 2016, using some of the new package management cmdlets that come with PowerShell. With the introduction of services like NuGet, Choclatey, PSGet and Package Manager, Windows finally has a great way of delivering software packages and modules directly from the internet or through an […]

Read more

Join Computer to Domain with Desired Computer Name and OU

Step #1: This is the simplest method to add a computer to a domain. In this example you will be prompted for credentials followed by the required reboot. PowerShell   1 2 Add-Computer -DomainName “your.domain.here” Restart-Computer Step #2: If you require an automated script without prompting the user for credentials you can provide the user account with rights to add […]

Read more

How To Build An Active Directory Site Inventory Report With PowerShell

If you’re having to deal with hundreds of subnets and multiple Active Directory sites, this PowerShell script will allow you to quickly build an inventory report listing all of your AD sites and subnets. Building An AD Site Inventory Report To do this, you’ll first need to ensure you’re either on a Windows Server 2008 R2 (or higher) domain controller […]

Read more

How to Get Weather Forecast In PowerShell

We will use an open source web service wttr.in to fetch the weather forecast. Wttr.in can be used not only to check the weather, but also for some other purposes. For example, you can see the current Moon phase. In PowerShell, there is a special alias “curl” for the built-in cmdlet Invoke-RestMethod, which can retrieve the URL contents from the PowerShell console. […]

Read more
1 2 3 4 5 11