Category Archives: powershell

No match was found for the specified search criteria for the provider ‘NuGet’

To solve the issue with nuget, open elevated powershell  (as admin), and perform the following command: [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 The command does not give any reply. This enables TLS1.2 which is probably required by now. Try your nuget command again. … Continue reading

Posted in nuget, powershell, TLS | Comments Off on No match was found for the specified search criteria for the provider ‘NuGet’

Working with Windows Active Direcory, transferring FSMO roles from one DC to another.

Today I had to move the fsmo-roles, and phase out an old DC. These days you can powershell it. Since you are working with Active Directory, log in as an admin user, fire up powershell and a do a: Import-Module … Continue reading

Posted in Active Directory, fsmo, powershell | Comments Off on Working with Windows Active Direcory, transferring FSMO roles from one DC to another.

Powershell connect to Azure

I needed this today to quickly find a solution as to why a virtual machine was not running, and had to retrieve some info about an application that runs a script. Start powershell as admin Set-ExecutionPolicy Unrestricted -force Install-Module AzureRM … Continue reading

Posted in Azure, powershell | Comments Off on Powershell connect to Azure

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.