Posts

Showing posts from October, 2012

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 bootable .iso file containing the content from c:\WinPE folder, but the folder itself isn't included. Boot file etfsboot.com can be found in Windows AIK. Refer to IMAPI_MEDIA_PHYSICAL_TYPE enumeration for possible media types: 

   …

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 carefull when it com…

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 MMMMMMMMMMMMMMMMMMMMMMM jMMMM
MMMNI…

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
}

Adobe Flash Auto Update disable script

Use the following vbs script in order to disable the auto update feature of adobe flash player.


' Adobe Flash Auto Update Manage
' Use this script in order to manage the auto update for adobe flash
' Author: Christos Polydorou, xristos.polydoroy@gmail.com

' This routine calculates the path to the flash installation directory
Function GetSystemPath()
Set wshShell = CreateObject( "WScript.Shell" )
GetSystemPath = wshShell.ExpandEnvironmentStrings( "%systemroot%" ) + "\system32\Macromed\Flash\mms.cfg"
End Function

' This routine saves data to a UTF-8 file
Sub Save2File (sText, sFile)
    Dim oStream
    Set oStream = CreateObject("ADODB.Stream")
    With oStream
        .Open
        .CharSet = "utf-8"
        .WriteText sText
        .SaveToFile sFile, 2
    End With
    Set oStream = Nothing
End Sub

' This routine enable the auto updater
Sub Enable
Save2File "AutoUpdateDisable=0", GetSystemPath()
End Sub

' This routine dis…

Adobe Reader X 10 GPO

Use the following file to change the settings of Adobe Reader X. The computer settings are in red, the user in green.


CLASS MACHINE
CATEGORY "Adobe Reader 10" 
CATEGORY "Preferences"
  CATEGORY "Updater" 
   POLICY "Do not download or install updates automatically" 
   KEYNAME "Software\Wow6432Node\Adobe\Adobe ARM\1.0\ARM" 
   EXPLAIN !!ExplainUpdaterDisable 
   VALUENAME "iCheckReader" 
   VALUEON NUMERIC 0 
   VALUEOFF NUMERIC 2 
   END POLICY 
  END CATEGORY 
   END CATEGORY
END CATEGORY

CLASS USER 
CATEGORY "Adobe Reader 10" 
CATEGORY "Adobe Reader 10.x MUI"
   POLICY "Use the same language as the Operating System"
   KEYNAME "Software\Adobe\Acrobat Reader\10.0\Language\UseMUI"
   EXPLAIN "With this policy enabled, the Adobe Reader MUI will display in the same language as the Microsoft Windows language.  
   For Microsoft Windows with MUI, the Adobe Reader MUI will display in the same language as …

Disable Adobe Updater using GPO

You can use the following ADM file to disable Adobe updater. Just copy the colored text into an ADM file and add it to your policy object.


CLASS MACHINE CATEGORY !!Reader         POLICY !!Checkforupdatesatstart
 KEYNAME "Software\Adobe\Acrobat Reader\9.0\AVGeneral"
            EXPLAIN !!Checkforupdatesatstart_Help
                VALUENAME "bCheckForUpdatesAtStartup"
                    VALUEON NUMERIC 1
                    VALUEOFF NUMERIC 0
        END POLICY         POLICY !!DonotdisplayEULA
            KEYNAME "Software\Adobe\Acrobat Reader\9.0\AdobeViewer"
            EXPLAIN !!DonotdisplayEULA_Help
                VALUENAME "EULA"
                    VALUEON NUMERIC 1
                    VALUEOFF NUMERIC 0
        END POLICY         POLICY !!EnableAdobeUpdater
            KEYNAME "SOFTWARE\Policies\Adobe\Acrobat Reader\9.0\FeatureLockdown"
            EXPLAIN !!EnableAdobeUpdater_Help
                VALUENAME "bUpdater"
                  …

Disable Java Updater using GPO

You can use the following ADM file to disable Java updater. Just copy the colored text into an ADM file and add it to your policy object.


CLASS MACHINE CATEGORY !!Java         POLICY !!Checkforupdatesatstart
 KEYNAME "SOFTWARE\JavaSoft\Java Update\Policy"
            EXPLAIN !!Checkforupdatesatstart_Help
                VALUENAME "EnableAutoUpdateCheck"
                    VALUEON NUMERIC 1
                    VALUEOFF NUMERIC 0
        END POLICY         POLICY !!EnableJavaUpdater
            KEYNAME "SOFTWARE\JavaSoft\Java Update\Policy"
            EXPLAIN !!EnableJavaUpdater_Help
                VALUENAME "EnableJavaUpdate"
                    VALUEON NUMERIC 1
                    VALUEOFF NUMERIC 0
        END POLICY END CATEGORY [strings]
Java="Ross' Java Template"
EnableJavaUpdater="Enable Java Updater"
EnableJavaUpdater_Help="When set to Enabled, Java Updater can run and the 'Check for updates' option appears on the Help…

Get GUIDs of installed software

You can get the GUIDs of installed software using the following Visual Basic script:


Set oWMIroot = GetObject("WinMgmts:root/cimv2")

Set oWMIColl = oWMIroot.ExecQuery("Select IdentifyingNumber, Name  FROM Win32_Product")

For Each oWMIval In oWMIColl
    WScript.Echo oWMIval.Name & " = " & oWMIval.IdentifyingNumber
Next

SCE 2007 SP1 Client Software Unistall

In order to uninstall the client software of System Center Essentials 2007 SP1 you can use the following commands:

msiexec.exe /x {E7600A9C-6782-4221-984E-AB89C780DC2D} /qn for the agent
msiexec.exe /x {11447AB1-2B37-49D3-9963-2ACDFA06E04B} /qn for the configuration helper

Windows Time Configuration

In order to configure the windows time service use the following commands:
w32tm /config /manualpeerlist:PEERS /syncfromflags:manual /update (Peers is a list of time servers, you may find many of them at http://www.pool.ntp.org/)net stop w32timenet start w32timew32tm /resync for domain members use /syncfromflags:domhier at step 1.
To check the time difference between the computer and the time server use the command:
w32tm /stripchart /computer:timeserver /samples:5 /dataonly