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
create login your_sql_loginname with password = 'your_sql_loginspassword', sid = {your_sql_user_sid} |
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
using System; | |
using System.Runtime.InteropServices; | |
namespace useraccountpicture | |
{ | |
class Program | |
{ | |
[DllImport("shell32.dll", EntryPoint = "#262", CharSet = CharSet.Unicode, PreserveSig = false)] | |
public static extern void SetUserTile(string username, int notneeded, string picturefilename); |
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
Imports System.Runtime.InteropServices | |
Module useraccountpicture | |
<DllImport("shell32.dll", EntryPoint:="#262", CharSet:=CharSet.Unicode, PreserveSig:=False)> _ | |
Private Sub SetUserTile(ByVal username As String, ByVal notneeded As Integer, ByVal picturefilename As String) | |
End Sub | |
Sub Main(ByVal args As String()) | |
If (args.Length = 2) Then |
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 SavePictureToAD(szADsPath, szLoadFileName) | |
Dim objUser, bytesRead, adoStreamRead | |
Const adTypeBinary = 1 | |
Set adoStreamRead = CreateObject("ADODB.Stream") | |
adoStreamRead.Type = adTypeBinary | |
adoStreamRead.Open | |
adoStreamRead.LoadFromFile szLoadFileName | |
bytesRead = adoStreamRead.Read() | |
adoStreamRead.Close |
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 SavePictureToAdFromUrl(szADsPath, szUrl) | |
Dim objUser, bytesRead, adoStreamRead | |
Const adTypeBinary = 1 | |
Set xml = CreateObject("Microsoft.XMLHTTP") | |
xml.Open "GET", szUrl, False | |
xml.Send | |
If xml.status = 200 Then | |
Set adoStreamRead = CreateObject("ADODB.Stream") |
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 LoadPictureFromAD(szADsPath, szSaveFileName) | |
Dim objUser, bytesRead, adoStreamWrite | |
Const adTypeBinary = 1, adSaveCreateOverWrite = 2 | |
Set objUser = GetObject(szADsPath) | |
bytesRead = objUser.Get("thumbnailPhoto") | |
Set adoStreamWrite = CreateObject("ADODB.Stream") | |
adoStreamWrite.Type = adTypeBinary | |
adoStreamWrite.Open |
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
use master | |
go | |
select sid, name, dbname from syslogins |
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
Set-ExecutionPolicy RemoteSigned | |
$UserCredential = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
Import-PSSession $Session | |
$DistributionGroup = "somerandomdistributiongroup@normanbauer.com" |
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
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption") | |
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume",,48) | |
Dim arEncryptionMethod | |
arEncryptionMethod = Array("None", "AES 128 With Diffuser", "AES 256 With Diffuser", "AES 128", "AES 256", "HARDWARE ENCRYPTION", "XTS AES 128", "XTS AES 256") | |
Dim arProtectionStatus | |
arProtectionStatus = Array("Protection Off", "Protection On", "Protection Unknown") |
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
<?xml version="1.0" encoding="utf-8"?> | |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> | |
<soap:Body> | |
<FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Traversal="Shallow"> | |
<ItemShape> | |
<t:BaseShape>IdOnly</t:BaseShape> | |
</ItemShape> | |
<ParentFolderIds> | |
<t:DistinguishedFolderId Id="deleteditems"/> | |
</ParentFolderIds> |
OlderNewer