Category Archives: powershell

Exchange 2016 Have a receive connector relay outside the domain.

There’s a powershell cmd for that: New-ReceiveConnector -Name “Anonymous Relay” -Usage Custom -AuthMechanism ExternalAuthoritative -PermissionGroups ExchangeServers -Bindings x.x.x.x:25 -RemoteIpRanges x.x.x.x (or create a receive connector with the right settings) And then Get-ReceiveConnector “Anonymous Relay” | Add-ADPermission -User “NT AUTHORITY\ANONYMOUS LOGON” -ExtendedRights … Continue reading

Posted in Exchange 2016, powershell | Comments Off on Exchange 2016 Have a receive connector relay outside the domain.

Exchange 2016 Restart Transport Service powershell

Ran into this earlier today, had to restart the Exchange 2016 transport service using powershell only! It turned out to be easy. Restart-Service MSExchangeTransport To list all Exchange services: Get-Service *Exchange*

Posted in Exchange 2016, powershell | Comments Off on Exchange 2016 Restart Transport Service powershell

User folder displayed as “Documents”: Remove desktop.ini

A users’ folder is displayed as “Documents” and you don’t want that. To e.g. remove desktop.ini files (which are hidden: use -force): Get-ChildItem “\\SERVER\d$\Users\Userdata\” -recurse -filter desktop.ini -force | foreach ($_) {remove-item $_.fullname -force} This deletes all the desktop.ini files … Continue reading

Posted in File sharing, powershell | Comments Off on User folder displayed as “Documents”: Remove desktop.ini

Get all different types of mailboxes in Exchange 2010 and 2016

I had to get the amount of the different types of mailboxes that are available in Exchange. Exchange 2010 and 2016 in this case. As I had to execute this as a script I ran into the problem that you … Continue reading

Posted in Exchange 2010, Exchange 2016, powershell | Comments Off on Get all different types of mailboxes in Exchange 2010 and 2016

Get a list of all computers in Active Directory with date lastlogon and OS

I needed to list all computers in use at customers, with os, and for the less diligently maintained AD’s also if they were still in use. You can obtain this by reading the value of lastlogondate of a machine account. … Continue reading

Posted in Active Directory, powershell | Comments Off on Get a list of all computers in Active Directory with date lastlogon and OS

Active Directory Powershell get [the count of] all enabled users in a certain OU [but not in sub OU’s]

For our internal use, I devised a powershell command that lists all enabled users in a certain OU, but filtering out those in sub OU’s. Unfortunately this is not a dynamic process, since it is based on the current implementation of OU’s, … Continue reading

Posted in Active Directory, powershell | Comments Off on Active Directory Powershell get [the count of] all enabled users in a certain OU [but not in sub OU’s]

Powershell, get full names of a group of users in AD and export to text file.

Just a quick blurb that I encountered this morning. In powershell, to get a list of the full names of users and export them to a text file: Get-ADGroupMember -identity GROUP -Recursive | Get-ADUser -Property DisplayName | Select Name > c:\temp\fullnamesofgroup.txt … Continue reading

Posted in Active Directory, powershell | Comments Off on Powershell, get full names of a group of users in AD and export to text file.