Skip to content

Instantly share code, notes, and snippets.

#requires -Version 3
#Usage:
#Invoke-command -computername $server -scriptblock {FunctionName -param1 -param2}
# Author: Matt Graeber
# @mattifestation
# www.exploit-monday.com
function Invoke-Command
{
[CmdletBinding(DefaultParameterSetName='InProcess', HelpUri='http://go.microsoft.com/fwlink/?LinkID=135225', RemotingCapability='OwnedByCommand')]
# Make "Disk utility" show hidden partitions:
defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
# Do not create .DS_Store files on network drives:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
# Insert Debug Menu on AppStore
defaults write com.apple.appstore ShowDebugMenu 1
# Then, Start download and then stop install, open the location, and create a hardlink like
## Exif Tool URL
http://www.sno.phy.queensu.ca/~phil/exiftool/
## Use Exif tool to set creation date to original date from the picture itself
exiftool.exe -recurse "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" path/to/pics/folder -overwrite_original -ext jpg -fixBase -progress
Example:
c:\tools\exiftool.exe -recurse "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" Z:\AdilBezen\Resimler\2013\2013.08\2013.08.Site -overwrite_original -ext jpg -fixBase -progress
GPO
Office 2010 SP1 Admin Templates:
Explanation: http://technet.microsoft.com/en-us/library/cc178992.aspx
Download: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=18968
# How to create custom .adm or .admx files to add search providers to the toolbar search box in IE7
http://support.microsoft.com/kb/918238
# Allowing Standard Users to Install Network Printers on Windows 7 without Prompting for Administrative Credentials
# Launch Command Line as 'Administrator'
cd "%ProgramFiles%\\Altiris\Altiris Agent"
regsvr32 AeXAgentDiagnostics.dll
## Resources ## Pro Git Book: http://git-scm.com/book
## Code school: https://www.codeschool.com/courses/try-git
## git stash:
## Sometimes when you go to pull you may have changes you don't want to commit just yet. One option you have, other than committing, is to stash the changes.
## Use the command 'git stash' to stash your changes, and 'git stash apply' to re-apply your changes after your pull.
## -u = remember, remote=origin, branch=master
git push -u origin master
## Get PDC Emulator in PowerShell
## With ADModule
(Get-ADDomain).PDCEmulator
## Without AD Module
$NTDSPDCEmulator = ([adsi]'').fsmoroleowner[0]
$PDCEmulator = ([adsi]"LDAP://$NTDSPDCEmulator").Parent
$PDC = ([adsi]$PDCEmulator).DnsHostName
## Query cim_datafile class to find an executable
# http://msdn.microsoft.com/en-us/library/aa387236(v=vs.85).aspx
get-wmiObject -query "select FileName,Extension,FileSize,Path,CreationDate,InstallDate,LastAccessed from cim_datafile where Drive='d:' AND FileName='powershell' and extension='exe'"
CreationDate : 20130822065947.699027-240
Extension : exe
FileName : powershell
FileSize : 479744
InstallDate : 20130822065947.699027-240
##AH - AdilHindistan - AD LastLogonTimeStamp
Summary:
Use LastLogonTimeStamp (replicated)
Use PasswordLastSet (ldap name: PwdLastSet) on GC (it get's replicated to GC. See Gist: https://gist.github.com/AdilHindistan/10896299)
http://msdn.microsoft.com/en-us/library/ms676824(VS.85).aspx
Last-Logon-Timestamp Attribute
This is the time that the user last logged into the domain.
Whenever a user logs on, the value of this attribute is read from the DC.
# Microsoft publishes a a spreadsheet that lists the all security bulletins since 1998.
URL: http://www.microsoft.com/en-us/download/details.aspx?id=36982