Category: PowerShell

WinRM over HTTPS

 12,744 total views,  15 views today Love0 Share Tweet Share Pin

 12,744 total views,  15 views today


November 6, 2022 0

Microsoft Graph API using PowerShell

 12,716 total views,  15 views today Love0 Share Tweet Share Pin

 12,716 total views,  15 views today


November 5, 2022 0

How to Modify Preferred DNS Settings via PowerShell

How to Update/Modify Preferred DNS Settings via Powershell To get the Existing DNS Settings run the below command, Get-DnsClientServerAddress Need to get Interface Index for which you need to modify and New DNS information To modify the DNS Settings, use the below command, Set-DnsClientServerAddress -InterfaceIndex 12 -ServerAddresses (“10.0.0.10″,”10.0.0.11”) Now you can check Preferred DNS Settings…
Read more

 3,101 total views,  4 views today


September 16, 2021 0

How to Modify AD User Attributes via PowerShell

In this article, we will see How to Get/Modify the Active Directory User Attributes via PowerShell. Below command help you to get all AD User attributes and values for the respective user1. Get-ADUser User1 -Properties * | fl You can use below command to filter with limited result, Get-ADUser User1 -Properties * | fl *Date*…
Read more

 3,126 total views,  4 views today


September 16, 2021 0

How to Extend Expired AD User Password

Active directory account passwords expire set (for example, every 45 days) in most of the organisations. Configuring an AD account with Password Never Expires is not recommended due to security. I came across the scenario to extend an active directory account’s current password expiration date without changing the password expiration policy.   Extend Expired AD…
Read more

 2,895 total views,  2 views today


September 11, 2021 0

AD User Password Expires Alert using PowerShell

I have created a script which helps to checking the password expire status of users in Active Directory. Here few login which we used in the script. Import-Module ActiveDirectory $PasswordAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge $ExpiryDate=$_.PasswordLastSet + $PasswordAge $DaysLeft=($ExpiryDate-$today).days Please contact us for above requirement.  2,354 total views,  3 views today Love0 Share Tweet Share Pin

 2,354 total views,  3 views today


August 29, 2021 0

Get AD User Created Last 7 Days

Below PowerShell scripts helps you get AD Users which is created last 7 days (N). $Date = (Get-Date).AddDays(-7).Date Get-ADUser -Filter { WhenCreated -ge $Date } ` -Properties WhenCreated,EmailAddress,Country | Select-Object WhenCreated,SamAccountName,GivenName,EmailAddress, Country | Export-Csv C:\CloudApex\Audit-Report.csv -NoTypeInformation   Note: Always recommend to test before using production infrastructure. try your own risk  2,287 total views,  2 views today Love0…
Read more

 2,287 total views,  2 views today


August 29, 2021 0

Get Folder Size using PowerShell

Below PowerShell script helps you to get Folder size in GB’s $excludes = @(“Program Files”,”Windows”,”Program Files (x86)”) $startFolder = “C:\” $colItems = Get-ChildItem $startFolder -Force  -erroraction SilentlyContinue | Where {($_.PSIsContainer) -and ($excludes -notcontains $_.Name)} | Sort-Object $b=0 foreach ($i in $colItems) { $subFolderItems = Get-ChildItem $i.FullName -recurse -force -erroraction SilentlyContinue| Where-Object {$_.PSIsContainer -eq $false}  |…
Read more

 2,275 total views,  3 views today


August 29, 2021 0

Event ID 5807 : Connections to this Domain Controller from client machines whose IP addresses don’t map to any of existing sites

Summary When client subnets are missing from active directory Sites and Services that results client to choose a incorrect domain controllers to communicate effectively with Directory Services. During DC localization process, Computer IP address matches against the subnets created in AD which helps to identify the subnet where client belongs to. If the DC cannot…
Read more

 2,467 total views,  3 views today


August 24, 2021 0

How to get Last Logon Time Stamp in Active Directory

How To Get Computer Last Logon Time Stamp Using PowerShell Open Active Directory Snap-in and run the below command with computer name for which you want to fetch the last logon time stamp Get-ADComputer -Identity ComputerName -Properties * |select name, LastLogonDate   Now, let see how to get it for bulk servers. First up all,…
Read more

 1,362 total views,  1 views today


August 22, 2021 0