This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$UpdateSession = New-Object -ComObject Microsoft.Update.Session | |
$UpdateSearcher = $UpdateSession.CreateupdateSearcher() | |
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates) | |
$Updates | Select-Object Title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module ActiveDirectory | |
$Users = Import-Csv -Delimiter "," -Path ".\users.csv" | |
foreach ($User in $Users) { | |
$SAM = $User.Username | |
$Displayname = $User.Displayname | |
$Firstname = $User.Firstname | |
$Lastname = $User.Lastname | |
$OU = $User.Container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AppxPackage -AllUsers | Remove-AppxPackage | |
Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls | |
echo "Generating report for deleted items folders..." | |
echo "Please wait..." | |
$data = @() | |
foreach($mbx in Get-MailboxDatabase | Get-Mailbox) { | |
$dispname = $mbx.displayName | |
$data += Get-MailboxFolderStatistics $mbx.identity | where{$_.FolderType -eq "DeletedItems"} | Select-Object @{n="Username";e={$mbx.displayName}}, @{n="TotalSizeIncSubfolders(MB)";e={$_.FolderAndSubFolderSize.ToMb()}}, ItemsInFolderAndSubFolders | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import glob | |
import shutil | |
import time | |
import logging | |
from datetime import datetime, date, timedelta | |
# start editable vars # | |
days_old = 28 # how old the files have to be before they are moved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
# start editable vars # | |
outputfile = "~/inventory.txt" # file to save the results to | |
folder = "~/test" # the folder to inventory | |
exclude = ['Thumbs.db','.tmp'] # exclude files containing these strings | |
pathsep = "/" # path seperator ('/' for linux, '\' for Windows) | |
# end editable vars # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub WriteIni( myFilePath, mySection, myKey, myValue ) | |
' This subroutine writes a value to an INI file | |
' | |
' Arguments: | |
' myFilePath [string] the (path and) file name of the INI file | |
' mySection [string] the section in the INI file to be searched | |
' myKey [string] the key whose value is to be written | |
' myValue [string] the value to be written (myKey will be | |
' deleted if myValue is <DELETE_THIS_VALUE>) | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function ReadIni( myFilePath, mySection, myKey ) | |
' This function returns a value read from an INI file | |
' | |
' Arguments: | |
' myFilePath [string] the (path and) file name of the INI file | |
' mySection [string] the section in the INI file to be searched | |
' myKey [string] the key whose value is to be returned | |
' | |
' Returns: | |
' the [string] value for the specified key in the specified section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On Error Resume Next | |
'Dim some stuffs | |
Dim objFso, objFolder, objFile, strFolderPath, intDaysOlderThan | |
Set objFso = CreateObject("Scripting.FileSystemObject") | |
'Change these variables | |
strFolderPath = "C:\Temp" | |
intDaysOlderThan = 28 |