Below is a powershell command I found to get the full IPv6 address:
gwmi win32_serversession | ft –Property ComputerName,UserName
gwmi win32_serversession | ft –Property ComputerName,UserName
# find stale computers in WSUS
# based on code:
# http://www.sapien.com/forums/scriptinganswers/forum_posts.asp?TID=4306
# http://msdn.microsoft.com/en-us/library/ee958382(v=VS.85).aspx
$smtpserver = "myExchangeServer"
$sender = "WSUS@myDomain.example"
$recipient = "Support@myDomain.example"
$maxAge = 14
$smtp = new-object Net.Mail.SmtpClient($smtpserver)
$msg = new-object Net.Mail.MailMessage
$msg.From = $sender
$msg.To.Add($recipient)
$msg.Subject = "WSUS Machines Not Checking-In Report"
$msg.Body = "<p>WSUS Machines that have not checked-in in the last $maxAge days</p>"
$msg.Body += "<table>"
$lastValidContactDate = $(Get-Date).Adddays(-$maxAge)
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
$computerScope = new-object Microsoft.UpdateServices.Administration.ComputerTargetScope
$computerScope.ToLastSyncTime = $lastValidContactDate
$wsus.GetComputerTargets($computerScope) | foreach {
$msg.Body += "<tr><td>" + $_.FullDomainName + "</td><td>" + $_.LastSyncTime + "</td></tr>"
}
$msg.Body += "</table>"
$msg.IsBodyHTML = $true
$smtp.Send($msg)
/Library/Vuzzlevuzz/LoginLauncher.app
/Library/Vuzzlevuzz/LogoutLauncher.app
/Library/Vuzzlevuzz/LoginItems
- place scripts to be run at login here
/Library/Vuzzlevuzz/LogoutItems
- place scripts to be run at logout here
/usr/bin/osascript <<-EOT
try
mount volume “smb://servername/share”
end try
EOT
/usr/bin/osascript <<-EOT
tell application “Finder” to eject “sharename”
EOT
1. sudo mkdir /Library/Vuzzlevuzz
2. sudo cp –r ~/Desktop/Vuzzlevuzz/* /Library/Vuzzlevuzz
3. sudo chmod a+x /Library/Vuzzlevuzz/LoginLauncher.app
4. sudo chmod a+x /Library/Vuzzlevuzz/LogoutLauncher.app
5. sudo chmod a+x /Library/Vuzzlevuzz/LoginItems/*
6. sudo chmod a+x /Library/Vuzzlevuzz/LogoutItems/*
7. sudo defaults write /Library/Preferences/loginwindow '{ AutoLaunchedApplicationDictionary = ({Hide = 1; Path = "/Library/Vuzzlevuzz/LoginLauncher.app"; });}'
8. sudo defaults write com.apple.loginwindow LogoutHook /Library/Vuzzlevuzz/LogoutLauncher.app
sudo nano /System/Library/SystemConfiguration/IPMonitor.bundle/Contents/Info.plist
<key>mdns_timeout</key>
<integer>2</integer>
mydomain.local
mydomain
sudo nano /etc/hosts
mydomain ipaddress_of_domain_controller
mydomain.local
/Local/Default
/Active Directory/MYDOMAIN/mydomain.local
/Active Directory/MYDOMAIN
' set some variables
servername = "myExchangeServer"
username = "DOMAIN\User"
password = "UserPassword"
' enumerate items in inbox
smsoapmessage =
"<?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>AllProperties</t:BaseShape>" _
& " </ItemShape>" _
& " <ParentFolderIds>" _
& " <t:DistinguishedFolderId Id='inbox'/>" _
& " </ParentFolderIds>" _
& " </FindItem>" _
& " </soap:Body>" _
& "</soap:Envelope>"
set req = createobject("microsoft.xmlhttp")
req.Open "post", "https://" &
servername & "/ews/Exchange.asmx", False,username,password
req.setRequestHeader "Content-Type", "text/xml"
req.setRequestHeader "translate", "F"
req.send smSoapMessage
if req.status = 200 then
set oXMLDoc = req.responseXML
set ResponseCode = oXMLDoc.getElementsByTagName("m:ResponseCode")
if ResponseCode(0).childNodes(0).text = "NoError" then
Set oXMLSubject = oXMLDoc.getElementsByTagName("t:Subject")
For i = 0 To (oXMLSubject.length -1)
set oSubject = oXMLSubject.nextNode
WScript.echo i & vbTab & oSubject.text
next
else
WScript.echo "Exchange server returned error: " & ResponseCode(0).childNodes(0).text
end if
else
WScript.echo "Failed to connect to Exchange server, error code: " & req.status
end if
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP1" />
</soap:Header>
<soap:Body>
<m:EmptyFolder DeleteType="HardDelete"
DeleteSubFolders="false">
<m:FolderIds>
<t:DistinguishedFolderId Id='inbox'/>
</m:FolderIds>
</m:EmptyFolder>
</soap:Body>
</soap:Envelope>
# uses du.exe from sysinternals
# http://technet.microsoft.com/en-us/sysinternals/bb896651.aspx
$dir="C:\users"
$smtpserver = "mail.example.local"
$sender = "sender@example.local"
$server = "file.example.local"
$recipient = "recipient@example.local"
$du=C:\utilities\du.exe -accepteula -l 1 $dir | sort -desc
$smtp = new-object Net.Mail.SmtpClient($smtpserver)
$msg = new-object Net.Mail.MailMessage
$msg.From = $sender
$msg.To.Add($recipient)
$msg.Subject = "$server Disk Usage Report"
$msg.Body = "<p>$server Disk Usage Report in KB</p>"
$msg.Body += "<table>"
$du[4 .. $du.length] | forEach-Object {
$fields = $_.split(" ",[StringSplitOptions]::RemoveEmptyEntries)
$msg.Body += "<tr><td>$($fields[0]) </td><td>$($fields[1 .. $fields.length]) <td></tr>"
}
$msg.Body += "</table>"
$msg.IsBodyHTML = $true
$smtp.Send($msg)
sh Optware0.99.163_arm-x19.qpkg
rm –rf /share/MD0_DATA/.qpkg/Optware
/opt/bin/ipkg update
(there will be some errors here but ignore them)/opt/bin/ipkg install rsnapshot
/opt/bin/ipkg install nano
nano
/opt/etc/rsnapshot.conf
snapshot_root /opt/var/rsnapshot
snapshot_root /share/MD0_DATA/rsnapshot
exclude /share/MD0_DATA/rsnapshot
exclude /share/MD0_DATA/Backup
exclude /share/MD0_DATA/Qdownload
exclude /share/MD0_DATA/Qmultimedia
exclude /share/MD0_DATA/Qrecordings
exclude /share/MD0_DATA/Qusb
exclude /share/MD0_DATA/Qweb
#interval hourly 6
interval daily 3650
#interval weekly 4
#interval monthly 12
#backup /etc/ localhost/
#backup /opt/etc/ localhost/
backup admin@<site1_ip_address>:/share/MD0_DATA/ <site1>
rsnapshot
configtest
ssh admin@<site1_ip_address> "echo `cat ~/.ssh/id_rsa.pub` >> ~/.ssh/authorized_keys"
nano
/tmp/config/autorun.sh
mount –t ext2 /dev/mtdblock5 /tmp/config
chown admin.administrators /mnt/HDA_ROOT/.config
umount /tmp/config
0 23 * * *
/opt/bin/rsnapshot daily
crontab
/etc/config/crontab
#!/bin/bash
recipient=recipient@example.local
sender=sender@example.local
subject="Site 1 Backup Report"
log=/opt/var/log/rsnapshot
tmpfile=/opt/var/log/rsnapshot.tmp
function log {
/bin/echo "[`date +%d/%b/%Y:%H:%M:%S`] $*\n" >> $log
}
if grep -q "rm -f /opt/var/run/rsnapshot.pid" $log
then
if grep -q ERROR: $log
then
status=FAILED
else
status=SUCCESSFUL
fi
else
status="FAILED, INCOMPLETE"
# The following lines safely kill the backup to stop it
# impacting performance during the day
# comment them out if you do not want this to happen
log "Backup window exceeded, terminating processes"
snapPID=`ps -ef | grep "/opt/bin/perl -w /opt/bin/rsnapshot daily" | awk '{print $1}'`
rsyncPID=`ps -ef | grep "/opt/bin/rsync -a --delete --numeric-ids" | awk '{print $1}'`
log "rsnapshot pid = $snapPID"
log "rsync pid = $rsyncPID"
log “Killing rsnapshot process”
kill $snapPID
log "Sleeping for 5 minutes to wait for rsnapshot to exit"
sleep 300
log “Killing rsync processes”
kill $rsyncPID
fi
echo To: $recipient > $tmpfile
echo From: $sender >> $tmpfile
echo Subject: $subject - BACKUP $status >> $tmpfile
echo "Disk space used by backups: $(rsnapshot du | grep total)" >> $tmpfile
echo "Most recent backup sizes: " >> $tmpfile
echo "$(du -sh /share/MD0_DATA/rsnapshot/daily.0/*)" >> $tmpfile
echo "Backup Log:" >> $tmpfile
cat $tmpfile $log | /mnt/ext/usr/sbin/ssmtp -v $recipient
rm $log
rm $tmpfile
chmod +x
/share/MD0_DATA/rsnapshot/check_backup.sh
0 7 * * * /share/MD0_DATA/rsnapshot/check_backup.sh
[~] # ls -Ahlt
/share/MD0_DATA/rsnapshot/
drwxr-xr-x 3
admin administ 4.0k Jul 10 23:21 daily.0/
drwxr-xr-x 3
admin administ 4.0k Jul
9 23:40 daily.1/
drwxr-xr-x 3
admin administ 4.0k Jul
8 23:41 daily.2/
drwxr-xr-x 3 admin
administ 4.0k Jul 7 23:37 daily.3/
drwxr-xr-x 3
admin administ 4.0k Jul
6 23:29 daily.4/
drwxr-xr-x 3
admin administ 4.0k Jul
5 23:27 daily.5/
drwxr-xr-x 3
admin administ 4.0k Jul
5 04:59 daily.6/
scp <source_file> <site1_ip_address>:<destination>
scp “/share/MD0_DATA/rsnapshot/daily.2/<site1>/share/MD0_DATA/Contractors/expenses.xls” <site1_ip_address>:/share/MD0_DATA/Contractors
[~] # ps aux | grep rs
31897 admin
3256 S /opt/bin/perl -w
/opt/bin/rsnapshot daily
32219 admin
2140 S /opt/bin/rsync -a
--delete --numeric-ids
32220 admin
4748 S /opt/bin/ssh -l admin
<site1_ip_address>
32301 admin
1932 S /opt/bin/rsync -a
--delete --numeric-ids
/opt/bin/perl
–w /opt/bin/rsnapshot daily
/opt/bin/rsync
….
kill 31897
ps aux |
grep rs
kill 32219
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//ENhttp://www.apple.com/DTDs/PropertyList-1.0.dtd>
3 <plist version="1.0">
4 <dict>
5 <key>Label</key>
6 <string>org.vuzzlevuzz.mapfolders</string>
7 <key>Program</key>
8 <string>/Library/Scripts/mapfolders.sh</string>
9 <key>RunAtLoad</key>
10 <true/>
11 </dict>
12 </plist>
1 #!/bin/bash
2 mkdir /Volumes/NETLOGON
3 /sbin/mount -t smbfs //servername/NETLOGON /Volumes/NETLOGON
4 /Volumes/NETLOGON/OSXLogon.sh
5 /sbin/umount /Volumes/NETLOGON
1 /bin/mkdir /Volumes/sharename
2 /sbin/mount -t smbfs //servername/sharename /Volumes/sharename
sudo chmod +x /Library/LaunchAgents/org.vuzzlevuzz.mapfolders.plistCopy mapfolders.sh to /Library/Scripts
'<filename>' could not be found. Check the spelling of the file name, and verify that the file location is correct. If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file has not been renamed, moved, or deleted.Problem machine Mac OSX running Office 2011