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
$VerbosePreference = 'Continue' | |
$Global:ErrorActionPreference="Stop" | |
$error.clear() | |
if (-not $fimwf) | |
{ | |
Throw "Failed to get workflow details from the FIM Target" | |
} | |
Write-Verbose "Processing FIM WF with TargetId: $fimwf" | |
### |
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
PS C:\FIMScripts\PowerShellWorkflow> $obj = Get-Resource -ObjectType WorkflowDefinition -AttributeName DisplayName -AttributeValue "___WF:PSWFTEST2" | |
PS C:\FIMScripts\PowerShellWorkflow> $obj | |
ClearRegistration : | |
CreatedTime : 02/11/2015 16:28:55 | |
Creator : urn:uuid:7fb2b853-24f0-4498-9534-4e10589723c4 | |
DeletedTime : | |
Description : | |
DetectedRulesList : {} |
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
$query=New-XPathQuery -AttributeName DisplayName -Operator StartsWith "__MPR:" | |
$Expression=New-XPathExpression -ObjectType "ManagementPolicyRule" -QueryObject $query | |
$AllMPRs=Search-Resources $Expression | |
ForEach ($MPR in $AllMPRs) | |
{ | |
$Resource=Get-Resource -ObjectType ManagementPolicyRule -AttributeName ObjectID -AttributeValue $MPR.ObjectID | |
$Resource.Disabled = "True" | |
#$Resource.Disabled = "False" | |
Save-Resource $Resource | |
} |
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
Export-FIMConfig -OnlyBaseResources -CustomConfig "/Request[RequestStatus='Post Processing']" | Convert-FimExportToPSObject |
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
Case "sn-HRMA-Import" | |
'HR attributes required are:Surname, AccountName | |
'Ensure that this attribute has spaced Hypens corrected | |
Dim surnamelogFileName As String = dtDateNowDay & "-" & dtDateNowMonth & "-" & dtDateNowYear & "_HRMA_Surname.log" | |
Logging.SetupLogFile(surnamelogFileName, loggingLevel) | |
If csentry("Surname").IsPresent Then | |
If csentry("Surname").Value.ToLower = "null" Then | |
mventry("sn").Delete() | |
If csentry("AccountName").IsPresent Then | |
Throw New Exception("Error in Surname (null) for FedID: " & csentry("AccountName").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
#CredMan stuff | |
$sig = @" | |
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] | |
public struct NativeCredential | |
{ | |
public UInt32 Flags; | |
public CRED_TYPE Type; | |
public IntPtr TargetName; | |
public IntPtr Comment; | |
public System.Runtime.InteropServices.ComTypes.FILETIME LastWritten; |
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
#CredMan stuff | |
$sig = @" | |
[DllImport("Advapi32.dll", SetLastError=true, EntryPoint="CredWriteW", CharSet=CharSet.Unicode)] | |
public static extern bool CredWrite([In] ref Credential userCredential, [In] UInt32 flags); | |
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] | |
public struct Credential | |
{ | |
public UInt32 flags; | |
public UInt32 type; | |
public IntPtr targetName; |
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
nano /etc/systemd/system/cpu-py.service | |
Add: | |
[Unit] | |
Description=cpu piglow python script | |
After=syslog.target network.target | |
[Service] | |
ExecStart=/usr/bin/python /usr/share/piglow/cpu.py |
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
nano /boot/config.txt | |
Add: | |
device_tree_param=bcm2709-rpi-2-b.dtb | |
device_tree_param=i2c1=on | |
device_tree_param=spi=on | |
nano /etc/modules-load.d/raspberrypi.conf | |
Add: i2c-dev | |
pacman -Syu |
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
$ErrorActionPreference = "Stop" | |
$Error.Clear() | |
##################################################### | |
# Function to generate mail content for licencing errors | |
Function MailBody | |
{ | |
$Exception=$error[0].Exception.Message | |
$Command=$error[0].InvocationInfo.Line | |
$StrBody="$Exception `r`r$Command `r`r##########################################################################################`r`r" | |
$Error.Clear() |