Skip to content

Commit

Permalink
quick sync of all pending work
Browse files Browse the repository at this point in the history
  • Loading branch information
compwiz32 committed Sep 18, 2019
1 parent 09b7531 commit 21b1f0e
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 0 deletions.
21 changes: 21 additions & 0 deletions !InProgress/Crap.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Invoke-Command -ComputerName 'boe-pc' -ScriptBlock {Get-ChildItem Cert:\LocalMachine\My | Where {$_.NotAfter -lt (Get-Date).AddDays(14)}} | ForEach {

[pscustomobject]@{

Computername = $_.PSComputername
Subject = $_.Subject
ExpiresOn = $_.NotAfter

DaysUntilExpired = Switch ((New-TimeSpan -End $_.NotAfter).Days) {
{$_ -gt 0} {$_}
Default {'Expired'}

}

}

}




27 changes: 27 additions & 0 deletions !InProgress/Crap2.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[‎7/24/2019 3:55 PM] Aul, Steve L:
No Title
$Names = Get-ChildItem -Path F:\TestUsers2 | ?{ $_.PSIsContainer } | Select-Object Name
foreach ($Name in $Names)
{
Get-ChildItem -Path "f:\TestUsers2\User1" -Recurse -exclude Z_Scans | Select -ExpandProperty FullName | Where {$_ -notlike '*Z_Scans*'} | sort length -Descending | Remove-Item -Recurse -WhatIf
}


$FullNames = Get-ChildItem -Path F:\TestUsers2 | ?{ $_.PSIsContainer } | Select-Object FullName
foreach ($FullName in $FullNames)
{
Get-ChildItem $FullName -Recurse -exclude Z_Scans | Select -ExpandProperty FullName | Where {$_ -notlike '*Z_Scans*'} | sort length -Descending | Remove-Item -Recurse -WhatIf
}



$Names = Get-ChildItem -Path F:\TestUsers2 | Where-Object { $_.PSIsContainer } | Select-Object Name

foreach ($Name in $FullNames)
{
$parentpath = "F:\TestUsers2\"
$A = Get-ChildItem -Path "$parentpath\$Name"
Write-Host $A
}


38 changes: 38 additions & 0 deletions !InProgress/Temp.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

Foreach ($_ in 1..13){Remove-JobTrigger -name ResetIIS -TriggerId $_}




$svrlist = get-content C:\scripts\Output\svrlist2.txt
$svrlist | ForEach-Object {
Write-Output "Checking: $_"
Get-WmiObject -Class Win32_Product -ComputerName $_ | where { $_.name -like '*netbackup*' -or $_.name -like '*rubrik*' } | Select-Object Pscomputername, Name, Version }


Get-WmiObject -Class Win32_Product -ComputerName crd-dc-wp01 | where { $_.name -like 'carbon*' }

$sites | ForEach-Object { New-ADOrganizationalUnit "LRD"+$_ -Path "OU=z-ParkerMigration-US,DC=LORD,DC=LOCAL" -Server crd-dc-wp01 }





$sites = Get-Content C:\Scripts\Input\Sites-NA.txt

$sites | ForEach-Object {
$letter1 = ((65..90) | Get-Random -Count 1 | ForEach-Object { [char]$_ }).ToString()
$letter1 = $letter.ToUpper()
$letter1

$letter2 = ((65..90) | Get-Random -Count 1 | ForEach-Object { [char]$_ }).ToString()
$letter2 = $letter.ToUpper()
$letter2

$num = Get-Random (0..10)

$DIVLOC = -join ('LRD', $num, $letter1, $letter2)

$temp = -join ($DIVLOC, "_", $_)
New-ADOrganizationalUnit $temp -Path "OU=z-ParkerMigration-US,DC=LORD,DC=LOCAL" -Server crd-dc-wp02 -Credential $cred
}
51 changes: 51 additions & 0 deletions Active-Directory/Get-UnlinkedGPOs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
function Get-UnlinkedGPOs {
<#
.Synopsis
.Description
.Parameter Server
.Example
.Notes
NAME: Get-UnlinkedGPOs
AUTHOR: Mike Kanakos
VERSION: 1.0.0
DateCreated: 2019-09-03
DateUpdated: 2019-09-03
v 1.0.0 - initial function creation
.Link
https://github.com/compwiz32/PowerShell
#>

[CmdletBinding()]
Param(
[alias('DC', 'DomainController', 'Computer', 'IPAddress')]
[Parameter(
AttributeValues)]
[String]$server

)

$GPOXML = Get-GPOReport -all -ReportType xml -Server $server

$List = New-Object -TypeName XML


}







Function Get-AllGPO {
Get-GPOReport -all -ReportType xml | % {
([xml]$_).gpo | Select-Object name, @{n = "SOMName"; e = { $_.LinksTo | % { $_.SOMName } } }, @{n = "SOMPath"; e = { $_.LinksTo | % { $_.SOMPath } } }
}
}

0 comments on commit 21b1f0e

Please sign in to comment.