Restructured Documentation
Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 8s
Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 8s
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
tags:
|
||||
- Group Policy
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
This document records the procedure for force group policy updates across the domain. Follow the environment assumptions and commands below.
|
||||
|
||||
```powershell
|
||||
$computers = Get-ADComputer -Filter * -SearchBase "OU=Computers,DC=bunny-lab,DC=io"
|
||||
$computers | ForEach-Object -Process {Invoke-GPUpdate -Computer $_.name -RandomDelayInMinutes 0 -Force}
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Identity and Certificates Documentation](<../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Reporting
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
Sometimes you need a report of every user in a domain, and if/when their passwords will expire. This one-liner command will help automate that reporting.
|
||||
|
||||
```powershell
|
||||
Get-Aduser -filter "enabled -eq 'true'" -properties passwordlastset, passwordneverexpires | ft Name, passwordlastset, Passwordneverexpires > C:\PWReport.txt
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Identity and Certificates Documentation](<../../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Reporting
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
This document records the procedure for inactive computers. Follow the environment assumptions and commands below.
|
||||
|
||||
```powershell
|
||||
$DaysInactive = 30
|
||||
$time = (Get-Date).Adddays(-($DaysInactive))
|
||||
Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name | Select Name
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Identity and Certificates Documentation](<../../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Reporting
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
This document records the procedure for inactive users. Follow the environment assumptions and commands below.
|
||||
|
||||
```powershell
|
||||
InactiveDays = 30
|
||||
$Days = (Get-Date).Adddays(-($InactiveDays))
|
||||
Get-ADUser -Filter {LastLogonTimeStamp -lt $Days -and enabled -eq $true} -Properties LastLogonTimeStamp |
|
||||
select-object Name,@{Name="Date"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('MM-dd-yyyy')}}
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Identity and Certificates Documentation](<../../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Email
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
This document records the procedure for check email aliases. Follow the environment assumptions and commands below.
|
||||
|
||||
!!! info "Prerequesite: [Connect to Azure AD](<Connect to Azure AD.md>)"
|
||||
|
||||
The uppercase `SMTP` address is the primary address, while lowercase `smtp` are aliases. You can find the value in active directory in **"User > Attribute Editor > proxyAddresses"**.
|
||||
|
||||
```powershell
|
||||
Get-AzureADUser -ObjectId "user@domain.com" | Select -Property ProxyAddresses
|
||||
```
|
||||
|
||||
!!! example "Example Output"
|
||||
|
||||
```powershell
|
||||
smtp:alias@domain.com
|
||||
smtp:alias@domain.onmicrosoft.com
|
||||
SMTP:primaryaddress@domain.com
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Identity and Certificates Documentation](<../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
Sometimes you will need to connect to Azure AD via powershell in order to perform troubleshooting / automation.
|
||||
|
||||
## Update Nuget Package Manager
|
||||
```powershell
|
||||
Install-PackageProvider -Name NuGet -Force -ForceBootstrap
|
||||
```
|
||||
|
||||
## Install AzureAD Powershell Modules
|
||||
You will need to install the modules for AzureAD before you can run the commands necessary for querying Azure.
|
||||
|
||||
```powershell
|
||||
Install-Module -Name AzureAD
|
||||
```
|
||||
|
||||
## Connect to AzureAD
|
||||
When you run the following command, it will open a dialog box to take the username, password, and MFA code (if applicable) for an administrative account in the Azure Active Directory.
|
||||
|
||||
```powershell
|
||||
Connect-AzureAD
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Identity and Certificates Documentation](<../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
tags:
|
||||
- Identity and Certificates
|
||||
- Scripts
|
||||
- Documentation
|
||||
---
|
||||
|
||||
# Identity and Certificates
|
||||
## Purpose
|
||||
Find scripts for identity and certificates. Follow the subject guide to choose the relevant environment and connect this material to the other document types.
|
||||
|
||||
## Includes
|
||||
- Active Directory
|
||||
- Microsoft 365
|
||||
|
||||
## Follow the Subject
|
||||
[Identity and Certificates](<../../reference/Identity and Certificates/index.md>) explains the relationships and offers starting points for the documented tasks.
|
||||
Reference in New Issue
Block a user