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
## From the adamtheautomator.com blog | |
Function Get-SccmClientLog ($ComputerName,$LogName) { | |
try { | |
Write-Debug "Initiating the $($MyInvocation.MyCommand.Name) function..."; | |
$output_properties = @{'ComputerName'=$ComputerName;'Log'=$LogName} | |
if ($LogName -ne 'setup') { | |
$sPath = "\\$ComputerName\admin$\ccm\logs" | |
$aLogData = @(); |
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
################################################### | |
# This is an associated snippet on learning Azure Functions by Jeff Brown at: | |
# https://adamtheatuomator.com/azure-functions-tutorial | |
################################################### | |
# The function URL appends the function name with a question mark and a code. This code is the function key and | |
# authenticates to the function for execution. Without this key, you would not be able to trigger the function. | |
# This key provides security so not just anyone can start the function. | |
$functionKey = '' ## Fill this in from the Get function URL page | |
$functionAppName = 'ata-powershell-functions' |
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
################################################### | |
# This is an associated snippet on learning Azure Functions by Jeff Brown at: | |
# https://adamtheatuomator.com/azure-functions-tutorial | |
################################################### | |
## The using statement imports the System.Net namespace, and param() defines the function's parameters. | |
using namespace System.Net | |
## Input bindings are passed in via param block. | |
## The *$Request* parameter contains the information passed to the function during the HTTP request. This information includes the request headers, request body, HTTP method, parameters, and URL of the request. |
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
#Requires -RunAsAdministrator | |
<# | |
.SYNOPSIS | |
This parses the native netstat.exe's output using the command line "netstat -anb" to find | |
all of the network ports in use on a local machine and all associated processes and services | |
.NOTES | |
Created on: 2/15/2015 | |
Created by: Adam Bertram | |
Filename: Get-LocalPort.ps1 |
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
#Requires -Version 3 | |
<# | |
.SYNOPSIS | |
This script checks a ConfigMgr site backup to ensure success and performs various post-backup functions that | |
back up other critical data that the built-in ConfigMgr site backup task does not. | |
.DESCRIPTION | |
This script checks any previous backup attempt ran within the last hour of this script running for a | |
a successful run if backup check is selected. It assumes you also have SSRS installed on the site DB server | |
and backs up both SSRS databases, exports out the SSRS encryption keys, backs up the export file and the |
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
<# | |
.NOTES | |
Created on: 5/22/2014 10:56 AM | |
Created by: Adam Bertram | |
Filename: Remove-CMDirectoryMembershipRule.ps1 | |
Credits: http://www.david-obrien.net/2013/02/24/remove-direct-membership-rules-configmgr/ | |
.DESCRIPTION | |
This script removes all direct membership rules from a specified collection name | |
.EXAMPLE | |
.\Remove-CMDirectMembershipRule.ps1 -SiteCode 'CON' -SiteServer 'SERVERNAME' -CollectionName 'NAMEHERE' |
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
## Found at https://adamtheautomator.com/get-eventlog-powershell/ | |
<# | |
.SYNOPSIS | |
This script searches a Windows computer for all event log or text log entries | |
between a specified start and end time. | |
.DESCRIPTION | |
This script enumerates all event logs within a specified timeframe and all text logs | |
that have a last write time in the timeframe or contains a line that has a date/time | |
reference within the timeframe. It records this information to a set of files and copies |
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
--- | |
- hosts: azurevms | |
gather_facts: no | |
tasks: | |
- name: Install IIS features | |
win_feature: | |
name: | |
- Web-Server | |
- Web-Common-Http | |
- Web-Mgmt-Service |
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 Get-InstalledSoftware { | |
<# | |
.SYNOPSIS | |
Retrieves a list of all software installed | |
.EXAMPLE | |
Get-InstalledSoftware | |
This example retrieves all software installed on the local computer | |
.PARAMETER Name | |
The software title you'd like to limit the query to. |
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
## Define each computer you'd like to run the install on | |
$computers = 'COMP1','COMP2','COMP3' | |
## This is the path that contains the installer file for the software you'd like to install on the servers | |
$softwarePath = '\\MEMBERSRV1\Software' | |
## Read each of the computers in the $computers array defined above | |
foreach ($pc in $computers) { | |
## Copy \\MEMBERSRV1\Software to each target computers' C:\Windows\Temp folder | |
Copy-Item -Path $softwarePath -Destination "\\$pc\c$\Windows\Temp" |