Posts

Live Mesh functionality with Skydrive

I myself am one of the people who used Live Mesh in order to sync my documents with skydrive. But with Mesh deprecated I can no longer select a folder an have it sync with skydrive, I have to move my files in the Skydrive folder. One solution to the problem is to create junctions using  junction . Lets say you have a directory called "testdir" on your desktop folder. You can use junction to make a junction point inside your skydrive folder that points to the folder "testdir". In order to do that you can use: junction Skydrive\dir desktop\testdir . If you want to delete the junction point just enter: junction -d skydrive\dir The only problem is that the directory cannot be on the network... Be very careful with junction point because the changes in the junction point affect the original folder too.

Create ISO files using Powershell

You can use the following function in order to create .ISO files using Windows Powershell: function New-IsoFile  {    <#     .Synopsis      Creates a new .iso file     .Description      The New-IsoFile cmdlet creates a new .iso file containing content from chosen folders     .Example      New-IsoFile "c:\tools","c:Downloads\utils"      Description      -----------      This command creates a .iso file in $env:temp folder (default location) that contains c:\tools and c:\downloads\utils folders. The folders themselves are added in the root of the .iso image.     .Example      dir c:\WinPE | New-IsoFile -Path c:\temp\WinPE.iso -BootFile etfsboot.com -Media DVDPLUSR -Title "WinPE"      Description      -----------      This command creates a boota...

Microsoft Exchange 2007 Permantly Delete Mailbox

When you delete a mailbox in Exchange Server 2007 using the Exchange Management Console or the remove-mailbox command in Exchange Management Shell the mailbox remains on the server for a specified period of time. You can get all the disconected mailboxes by using the following command on Exchange Management Shell: Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid This command displays the name of the user and the GUID of the mailbox so you can use it in order to delete it. To remove a single mailbox you can use the this command: Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid> -confirm:$false You can delete all the disconected mailboxes with this command: Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName, MailboxGuid, Database |  ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false } Be very...

Harvest email addresses using Backtrack and msfconsole

Hello all, Most of you probably already know what i am about to explain here. But bear with me Tools you will need : 1) Backtrack 5 ( Contains Msfconsole by default ) Instructions : 1) Lets begin by opening your shell command on Backtrack 5. 2) Next type the following commands shown below : root@root:~# msfconsole NOTICE: CREATE TABLE will create implicit sequence “hosts_id_seq” for serial column “hosts.id” NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index “hosts_pkey” for table “hosts” NOTICE: CREATE TABLE will create implicit sequence “clients_id_seq” for serial column “clients.id” NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index “clients_pkey” for table “clients” * Allow Msfconsole to fully load till the screen below appears. MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMM MMMMMMMMMM MMMN$ vMMMM MMMNl MMMMM MMMMM JMMMM MMMNl MMMMMMMN NMMMMMMM JMMMM MMMNl MMMMMMMMMNmmmNMMMMMMMMM JMMMM MMMNI MMMMMMMMMMMMMMMMMMMMMMM jMMMM MMMNI MMMMMM...

Case insensitive String.Contains for C#

So, you want to use the String.contains method but you want it to be case insensitive. You can use the following test instead: string s = "MYSTRING"; if( s.IndexOf("string", 0, StringComparison.CurrentCultureIgnoreCase) != -1 ) {     // String contains "string" } else {    // String does not contain "string" } We use "-1" because "0" can be an index

Username to SID Assosiation

To find the sid of a user using the username and vice versa use the following command: wmic useraccount get name,sid

PowerShell Ping Function

You can use the following boolean function to ping a host using powershell: function Ping-Host {param( [string]$HostName, [int32]$Requests = 3) for ($i = 1; $i -le $Requests; $i++) { $Result = Get-WmiObject -Class Win32_PingStatus -ComputerName . -Filter "Address='$HostName'" Start-Sleep -Seconds 1 if ($Result.StatusCode -ne 0) {return $FALSE} } return $TRUE }