Thursday, April 4, 2013
Export email from exchange 2010
Grant a user rights to perform a mailbox export, by default no one has this:
New-ManagementRoleAssignment –Role "Mailbox Import Export" –User Administrator
Create a network share to dump the exported mail to. This must be a network share as the command requires the file to be dumped to a unc.
Command to export mail:
New-MailboxExportRequest -Mailbox mailbox -FilePath \\server\share\file.pst
View progress:
Get-MailboxExportRequest
Once it is complete you need to clear the request:
Get-MailboxExportRequest | where {$_.status -eq "Completed"}
Tuesday, April 2, 2013
Tool to query AD
Numerous built in queries for cmoputers, contacts, users and groups. Download the free version or buy the version with more features:
http://www.cjwdev.co.uk/Software/ADReportingTool/Info.html
Free version lets you export to csv.
Edit host file via command line
echo 0.0.0.0 websitename.com >> %SYSTEMDRIVE%\Windows\System32\Drivers\Etc\Hosts
Wednesday, February 27, 2013
List users in an active directory group
dsquery group domainroot -name groupname | dsget group -members | dsget user -fn -ln >output.csv
This will dump a list of users in the "groupname" you have entered.
Wednesday, January 16, 2013
Exchange anonymous Relay
Exchange 2007/10 needs a new receice connector created, leave the local network set to default, change remote servers to be just the IP of the device you want to be able to relay. After the connector is created, edit it, remove all checks from authentication boxes, add a check to anonymous on the permission group. Open powershell and run:
Get-ReceiveConnector “Anonymous Relay” | Add-ADPermission –User “NT AUTHORITY\ANONYMOUS LOGON” –ExtendedRights “Ms-Exch-SMTP-Accept-Any-Recipient”
This assumes you named the relay "anonymous relay"
Monday, December 31, 2012
Show exchange user mailbox size from Powershell
Get-MailboxStatistics -Server YOURSERVERNAME | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label=”TotalItemSize(KB)”;expression={$_.TotalItemSize.Value.ToKB()}},ItemCount
You need to change SERVERNAME to your server, you can change KB to MB for totalitemsize.value to show in MB.
Monday, December 10, 2012
Disable Windows 7 Firewall by command line
Domain Profile:
Netsh advfirewall set domainprofile state off
Private Profile:
Netsh advfirewall set privateprofile state off
Public Profile:
Netsh advfirewall set publicprofile state off
Or to disable all:
Netsh advfirewall set all state off
Show profile status:
Netsh advfirewall show allprofiles
Subscribe to:
Posts (Atom)