Backtrack:  
 
showing posts tagged with 'powershell'
1 · 2 · 3
 
edited by on June 11th 2015, at 15:09

You can easily convert an Exchange mailbox from one type to another through the Exchange Management Shell.

Set-Mailbox -Identity user.name -Type Regular

There are four types you can use to convert to:

  • Regular (User mailbox);
  • Shared
  • Equipment
  • Room

The Equipment and Room types are used for reservations of meeting rooms and equipment (DLP).

edited by on May 26th 2015, at 14:49

By default, it is not possible to specify passwords (the SecureString type) directly as a plain-text cmdlet parameter because it is unsecure to do so (and they are right). But sometimes, there's no other way to run a cmdlet without specifying the password as plain text as a cmdlet parameter. Luckily, there's an easy workaround by performing a conversion from plain text and store the password in a SecureString object.

$pw = ConvertTo-SecureString -String "your-pw" -AsPlainText -Force

You can then use the $pw object to specify the password in a cmdlet.

For example: resetting the password of an AD account:

Set-ADAccountPassword -Identity my-account -NewPassword $pw
edited by on March 19th 2015, at 12:39
Using the vSphere (Web) Client, it is only possible to "upgrade" your virtual hardware to the latest version supported by your ESX host. Sometimes, it's necessary to set the hardware version to a specific version, rather than just the latest supported one. This can be done through PowerCLI (for use with vCenter) or ESXi Shell (for free ESXi).

Before you begin, note that you have to power down a VM before you can change the hardware version.

You need VMWare vSphere PowerCLI installed on a computer, and access to a vCenter server (can be appliance or full version for Windows) with the necessary credentials.

Connect to the vSphere server:

$cred = Get-CredentialConnect-VIServer -Se  ...
edited by on March 18th 2015, at 13:38
When implementing AD/Dirsync to synchronize your on-premise AD with Office365, you may have to change the UPN-suffix to match the (e-mail) domain name used in your Office365 tenant. Most often, the local UPN-suffix would be something like domain.local, and would then have to be changed to domain.com. With a lot of users, it can quickly become tedious to change this manually. Along came Powershell...

The attached script is an easy way to quickly change the UPN-suffix for all users in a particular OU. Simply adjust the parameters to match your configuration, and let it run. Note that the script runs recursively, so be careful when running this on a top-level OU, as it will cascade through a  ...
edited by on March 13th 2015, at 13:08

Since Exchange 2010 SP1, when giving users Full access to another mailbox, they automatically get that mailbox added to their Outlook (2007 and up). This feature is called mailbox auto-mapping, and has made life a little easier for us IT administrators. But sometimes, you do not want a mailbox to be auto-mapped in Outlook for a particular user.

This can be achieved by setting the access permission through Powershell, and including the parameter -AutoMapping:$false in the cmdlet.

Add-MailboxPermission "Shared Mailbox" -User <user> -AccessRights FullAccess -AutoMapping:$false
edited by on March 10th 2015, at 16:12
You can easily view message tracking logs through the Exchange Management Shell (EMS). The cmdlet to use is called Get-MessageTrackingLog, and roughly provides the same search queries as before, and to be honest, it's faster than using the GUI in older Exchange versions, once you get to know the syntax. And thanks to the power of Powershell, you have a lot more options about exporting said data (e.g. to CSV).

The basic syntax is as follows:

Get-MessageTrackingLog [-Server <ServerIdentity.] [-ResultSize <Integer> | Unlimited] [-Start <DateTime>] [-End <DateTime>] [-EventId <EventId>] [-InternalMessageId <InternalMessageId>] [-MessageId <MessageId>] [-M  ...
edited by on February 17th 2015, at 12:45

Using EMS (Exchange Management Shell), you can quickly retrieve a list of mailboxes not using the default quotas:

Get-Mailbox | Where { $_.UseDatabaseQuotaDefaults -eq $False } | Select Name,UseDatabaseQuotaDefaults,ProhibitSendQuota
edited by on November 12th 2014, at 16:45

Technically, you can't set up out-of-office for shared mailboxes through a normal way, because you can't log in with Outlook on those accounts. A workaround would be to temporarily convert it to a regular mailbox, grant a license to it, and then log in with Outlook, but this is not always possible or desired.

Fortunately, you can also enable out-of-office through Powershell on any mailbox, including shared and resource mailboxes.

http://support.microsoft.com/kb/2667296

edited by on April 19th 2013, at 10:23
To make your custom cmdlets (functions) available in your PowerShell sessions, there are a few methods.

To do a one-time import of functions in your current session, store the functions in a PS1-file and save it somewhere. Then, in your session run the following:

. "path-to-file"

Notice the dot and a space behind it. This method, called "dotting" does a one-time import in the current session. This is useful for when you have functions that you don't use often, and don't want them to be available at all times.

An alternative method is to save the functions as a PSM1-file (extension .psm1) to create a module file, then use Import-Module to import your functions.

Import  ...
by on January 1st 1970, at 01:00
Here's a quick and dirty guide to the setup of a read-only Domain Controller (RODC) on a Core-based installation.

Deploy your Core-based server like you normally would.

Using sconfig, perform these tasks in order:

Configure network.

Optionally, configure computer name.

Join the computer to the domain.

After the reboot, install the required role via Powershell:

Install-WindowsFeature AD-Domain-Services

After that's successful, using Powershell, promote the server to an RODC (adjust parameter values accordingly):

Install-ADDSDomainController -Credential (Get-Credential) -DomainName domain.local -SiteName "Default-First-Site-Name" -InstallDNS:$true -ReadOnlyReplica:$true -For  ...
by on January 1st 1970, at 01:00

You can easily trigger SCSI UNMAP in Windows via PowerShell:

Optimize-Volume -DriveLetter C -ReTrim -Verbose
by on January 1st 1970, at 01:00
When installing Powershell modules from the gallery, you may run into the following error, particularly on older versions of Windows (even Windows 10):

PS C:\WINDOWS\system32> Install-Module -Scope AllUsers -Name module-nameWARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2/'.PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'module-name'. Try Get-PSRepository to see all available registered module repositories.

The most common reason for this (aside of having some other issue with internet access) is that Powershell may still be using TLS 1.0, which is no longer supported by Powershell Gallery.

To   ...
1 · 2 · 3
 
showing posts tagged with 'powershell'