This file contains hidden or 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
<!-- | |
Simple proof-of-concept to create a .ics calendar event with visualforce. | |
Inspired by Natalie Regier @gnatrae | |
This example uses url parameters to set the details of event. | |
You could create a custom button that invokes this page, like: | |
https://<your-salesforce-domain>/apex/vCalendarPage?start={!TEXT(Obj.StartDate__c)}&end={!TEXT(Obj.EndDate__c)}&subject=Event from Visualforce&description=This .ics event created with visualforce&location=The Cloud | |
An example with literal values you can copy & paste in your browser: | |
https://<your-salesforce-domain>/apex/vCalendarPage?start=20140524T140000&end=20140524T153000&subject=Event from Visualforce&description=This .ics event created with visualforce&location=The Cloud |
This file contains hidden or 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
cat C:\OLD_Computers.csv | Get-ADComputer | Remove-ADObject |
This file contains hidden or 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 | |
$DaysInactive = 90 | |
$time = (Get-Date).Adddays(-($DaysInactive)) | |
# Get all AD computers with lastLogonTimestamp less than our time | |
Get-ADComputer -Filter {LastLogonTimeStamp -lt $time -and OperatingSystem -notlike "*server*"} -Properties LastLogonTimeStamp,OperatingSystem | | |
# Output hostname and lastLogonTimestamp into CSV | |
select-object Name | export-csv C:\OLD_Computers.csv -notypeinformation |
This file contains hidden or 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
public DateTime convertISO8601(string str) | |
{ | |
return (DateTime)json.deserialize('"' + str + '"', datetime.class); | |
} |
This file contains hidden or 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
public class JsonParser{ | |
public glossary glossary{get;set;} | |
public class GlossList{ | |
public GlossEntry GlossEntry{get;set;} | |
} | |
public class GlossEntry{ | |
public String Abbrev{get;set;} | |
public String Acronym{get;set;} | |
public String GlossTerm{get;set;} | |
public GlossDef GlossDef{get;set;} |
This file contains hidden or 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
{ | |
"glossary": { | |
"title": "example glossary", | |
"GlossDiv": { | |
"title": "S", | |
"GlossList": { | |
"GlossEntry": { | |
"ID": "SGML", | |
"SortAs": "SGML", | |
"GlossTerm": "Standard Generalized Markup Language", |
This file contains hidden or 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
$files = Get-ChildItem [INPUT FOLDER PATH - e.g C:\Data\]*.csv | |
Get-Content $files | Set-Content [OUTPUT FILE PATH - e.g C:\Data\MergedCsvFile.csv] |
This file contains hidden or 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
.project | |
.settings | |
.metadata | |
salesforce.schema | |
Referenced Packages | |
*.sublime-project | |
*.sublime-settings | |
*.sublime-workspace | |
apex-scripts/log | |
build.properties |
This file contains hidden or 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 sendLoggingEMail($subject,$message){ | |
Write-Host "Sending Email" | |
#Exchange Server | |
$exchangeServer = "Exchange Address e.g webmail.domain.tld" | |
#Creating a Mail object | |
$msg = new-object Net.Mail.MailMessage | |
#Creating SMTP server object | |
$smtp = new-object Net.Mail.SmtpClient($exchangeServer) | |
#Email structure | |
$msg.From = "[email protected]" |
This file contains hidden or 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
#!/bin/bash | |
USER="BACKUP-USER-ACCOUNT" | |
PASSWORD="BACKUP-USER-PASSOWRD" | |
TIME_STAMP=$(date +%Y-%m-%d-%T) | |
ROOT_BACKUP="BACKUP-LOCATION-ROOT" | |
BACKUP_LOCATION="${ROOT_BACKUP}/${TIME_STAMP}" | |
mkdir -p ${BACKUP_LOCATION} |