Solved

How can I do a query in powershell to see what a current setting is before I make changes?

Posted on 2015-01-27
4
57 Views
Last Modified: 2015-02-03
I'm not very well aquainted with PowerShell, but there are commandlets that I'd like to use for Exchange. Before I make changes, I'd like to do a query just to see what some settings are at. Is there a universal way to do this in powershell? For example, the same command can give me the status of what a setting is, either "default", or "yes", or "no"?

Thanks in Advance
0
Comment
Question by:mmahelpdesk
4 Comments
 
LVL 39

Accepted Solution

by:
footech earned 250 total points
ID: 40573195
Not universal, but in general in PowerShell for each cmdlet that performs a specific action (or deals with a group of settings), that cmdlet has a "Set-" prefix, and there is usually a matching cmdlet with a "Get-" prefix to retrieve current settings.
0
 
LVL 35

Expert Comment

by:Mahesh
ID: 40573235
you can end command with -whatif switch which can tell you what options are there for yes \ no

Also you can get existing setting by piping to get full list, format list

You can check command for all parameters and examples with
Get-Help cmdlet -examples
OR
Get-Help cmdlet -Full
0
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 250 total points
ID: 40573256
Most common commands to get user data are below...

Active Directory
Get-ADUser -Identity <samacountname> -Properties * | fl

Open in new window

The above code will list all of the properties in a list format for a specific user

Exchange
Get-Mailbox -Identity <alias> | fl 

Open in new window

The above code shows default mailbox properties

Get-CASMailbox -Identity <alias> | fl

Open in new window

The above code will show specific CAS services that are enabled on a users mailbox

Get-MailboxStatistics -Identity <alias> | fl

Open in new window

The above code will get detailed information about the users mailbox like Size/Item Count/etc

Will.
0
 
LVL 1

Author Closing Comment

by:mmahelpdesk
ID: 40587209
Awesome, this is exactly what I needed. Thanks!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video discusses moving either the default database or any database to a new volume.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now