Category Archives: PowerShell

password never expires

<# This script find all the users whose passwords never expire and send a report to mail. Idit Bnaya #> Import-Module activedirectory $date=Get-Date $date1 = $date.ToShortDateString() $date2 = $date1.Replace("/","_") $FolderPath = ‘c:\temp’   Get-ADUser -filter * -Properties PasswordNeverExpires | where … Continue reading

Posted in PowerShell | Tagged , | Leave a comment

Invoke-Command in PowerShell script without password

sometimes you need to write a script to run commands on remote servers or computers and you need to use the “Invoke-Command” method but you do not want to keep the password in clear text inside of your ps1 file. … Continue reading

Posted in PowerShell | Leave a comment

How to set all virtual directories at once With PowerShell

For internal URLs: $urlpath = Read-Host "Type internal Client Access FQDN starting with http:// or https://" Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath/autodiscover/autodiscover.xml” Set-webservicesvirtualdirectory –Identity * –internalurl “$urlpath/ews/exchange.asmx” Set-oabvirtualdirectory –Identity * –internalurl “$urlpath/oab” Set-owavirtualdirectory –Identity * –internalurl “$urlpath/owa” Set-ecpvirtualdirectory –Identity * –internalurl … Continue reading

Posted in Exchange 2010, Exchange 2013, Microsoft Exchange, PowerShell | Tagged , , , | Leave a comment

Office 365 – Manage licenses – ADD\Remove

1. Assign License Using the office365 portal · From the office365 Portal · Connect to – Office365 Portal with the right permissions (Or global administrator or User management administrator) · In the left section Go to the Users and Groups … Continue reading

Posted in Office365, Office365 Proplus, PowerShell, SharePoint Online | Tagged , , , , | Leave a comment

Powershell error : “.ps1 cannot be loaded because the execution of scripts is disabled on this system”

When You are trying to run a PS1 script in Power shell you are getting the following error: “File C:\scripts\.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get- help about_signing” for more … Continue reading

Posted in PowerShell, Windows | Tagged , | Leave a comment