Tag: powershell

Microsoft Teams – Welcome Message

Microsoft teams can send welcome messages when a user is added to the teams. This behavior can be altered with powershell The current setting for the team can be checked with powershell. To run this, you need to…

Read More »

Last Logon Date AD Users

source: https://gallery.technet.microsoft.com/scriptcenter/Get-Last-Logon-for-Users-c8e3eab2 The “lastLogon” Active Directory attribute is a property that is not replicated throughout the Domain Controllers.  This attribute is stored on the domain controller that received the authentication request and updated its property accordingly.  Because of…

Read More »

Get Office 365 users with a specific license type via Powershell

It can sometimes be useful to get a list of Office 365 users with a specific license type via PowerShell. Instead of logging into the Office 365 portal and using a filtered view in the admin center, you…

Read More »

Create a Dynamics NAV NST Instance with Powershell

How to create a NST instance with a powershell script:   Set-ExecutionPolicy -ExecutionPolicy Unrestricted Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted Import-Module “C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1” -DisableNameChecking # Set varaibles for NST $NAVServiceInstance = ‘instance-name’ $DatabaseName = ‘database-name’ $DatabaseServer =…

Read More »

Sending test email with powershell

Use the following command to send a test email with powershell:   Send-MailMessage –From sender@domain.com –To recipient@domain.com –Subject “Test Email” –Body “This is a test email” -SmtpServer smtpserver.fqdndomain.local

Read More »

Synching Microsoft NPS (RADIUS) servers

source: http://www.routereflector.com/2016/07/syncing-microsoft-nps-servers/ Use the following powershell script to sync microsoft NPS (radius) servers. Export-NpsConfiguration -Path C:\TEMP\LocalNPSExportedConfig.xml $CurrentServerNPS = $env:computername $NPServers = Get-ADGroupMember “RAS and IAS Servers” $NPServers | ForEach-Object { $NPServerName = $_.Name if ($NPServerName -ne $CurrentServerNPS) { $NPServerName…

Read More »

Quickly list all mailboxes to which a particular user has access

From Vasil Michev source: http://www.michev.info/Blog/Post/77/Quickly-list-all-mailboxes-to-which-a-particular-user-has-access   List all mailboxes to which a particular user has Full Access permissions: PS C:\> Get-Mailbox | Get-MailboxPermission -User vasil Identity             User                 AccessRights ——–             —-                 ———— HuKu                 Vasil Michev         {FullAccess} retail               Vasil Michev        …

Read More »

Find Mailbox and Online Archive size

Script to connect to Office 365 and collect the last logged on date/time, mailbox size and item count for each mailbox and archive mailbox for every user within your organization. The following script was specifically written for a…

Read More »

Customizing the RDS title “Work Resources” using PowerShell on Windows Server 2012

See http://social.technet.microsoft.com/wiki/contents/articles/13451.customizing-the-rds-title-work-resources-using-powershell-on-windows-server-2012.aspx   If you are running multiple Connection Brokers in High Availability mode, you must run this against the active broker. You can use this command: Set-RDWorkspace -Name “XYZ Applications” -ConnectionBroker (Get-RDConnectionBrokerHighAvailability).ActiveManagementServer   Otherwise you can use: set-RDWorkspace…

Read More »

VMware get inventory

source: http://www.wooditwork.com/2010/08/16/exporting-all-that-useful-vm-information-with-powercli/ To export a list of usefull information about your environment use the following oneliner to export it to a CSV. Get-VM | Select Name, PowerState, NumCPU, MemoryMB, ProvisionedSpaceGB, UsedSpaceGB, @{N=”ESX Host”;E={Get-VMHost -VM $_}}, @{N=”Datastore”;E={Get-Datastore -VM $_}}, @{N=”Guest…

Read More »