Added scripts

This commit is contained in:
Tobias Rydh
2023-05-23 17:02:39 +02:00
parent e6cdde5ad7
commit 6e544a16d2
6 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
$Printers = Import-Csv -Path "C:\temp\PrinterList.csv" -Encoding UTF8 -delimiter ","
foreach ($Printer in $Printers)
{
Add-PrinterPort -Name $Printer.IP -PrinterHostAddress $Printer.IP -Verbose
Add-Printer -Name $Printer.PrinterName -DriverName $Printer.Driver -Location $Printer.Location -PortName $Printer.IP -Verbose
}

View File

@@ -0,0 +1,11 @@
get-Acl -Path C:\users\* | out-gridview
$FolderPath = Get-ChildItem -Directory -Path "C:\users\*"
ForEach ($Folder in $FolderPath) {
$Acl = Get-Acl -Path $Folder.FullName
ForEach ($Access in $Acl.Access) {
$Properties = [ordered]@{'Folder Name'=$Folder.FullName;'Group/User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}
New-Object -TypeName PSObject -Property $Properties
Out-GridView }
}

View File

@@ -0,0 +1,12 @@

$server = 127.0.0.1
$starttime = get-date -Format yyyy-MM-dd
Get-EventLog Application -ComputerName $server -After $starttime |
? { $_.entryType -Match "Error" -and "Critical" } |
Group-Object -Property EventID |
% { $_.Group[0] | Add-Member -PassThru -NotePropertyName Count -NotePropertyValue $_.Count } |
Sort-Object EventID -Unique |
Select-Object Count, TimeGenerated, EventID, Source, Message |
ft -AutoSize -Wrap |
Out-File $file -Append