Monday, October 29, 2012

How to copy large file across the network on windows environment?



Scenerio:
1.       Sample 10 GB dummy file was created on the Jump Server (*****001)

Cmd:  Fsutil file createnew bigfile.out 10737418240

10 GB =  10*1024*1024*1024 bytes

Note: CMD should be run with administrator’s credentials.

2.       Go to Destination server (*******03)

>robocopy C:\bigfile \\******.59\soumen bigfile.out








Unable to Delete File ?

Utility: Handle.exe from Sysinternals

The syntax is handle.exe -p -c -y.

C:\Toolbox>Handle.exe plugin.jar

Handle v3.2
Copyright (C) 1997-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

firefox.exe pid: 5508 5B4: C:\Java\jre5\lib\plugin.jar
java.exe pid: 4632 638: C:\Java\jre5\lib\plugin.jar
java.exe pid: 6332 628: C:\Java\jre5\lib\plugin.jar

C:\Toolbox>Handle.exe -p 5508 -c 5b4 -y

Handle v3.2
Copyright (C) 1997-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

 5B4: File (RW-) C:\Java\jre5\lib\plugin.jar

Handle closed.

C:\Toolbox>Handle.exe plugin.jar

Handle v3.2
Copyright (C) 1997-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

java.exe pid: 4632 638: C:\Java\jre5\lib\plugin.jar
java.exe pid: 6332 628: C:\Java\jre5\lib\plugin.jar

C:\Toolbox>

OR

Handle.exe -a > List.txt

Search the file which needs to be deleted.

And follow the above process.

Example

Tuesday, October 9, 2012

List Disk Space Status for Bulk Server ?


# Issue warning if % free disk space is less
$percentWarning = 15;
# Get server list
$servers = Get-Content "$Env:USERPROFILE\Desktop\SUBHAG\POWERSHELL\POWERSHELL\servername.txt";
$datetime = Get-Date -Format "yyyyMMddHHmmss";

# Add headers to log file
Add-Content "$Env:USERPROFILE\\Desktop\SUBHAG\POWERSHELL\POWERSHELL\server disks $datetime.txt" "server,deviceID,size,freespace,percentFree";

foreach($server in $servers)
{
# Get fixed drive info
$disks = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3";

foreach($disk in $disks)
{
$deviceID = $disk.DeviceID;
[float]$size = $disk.Size;
[float]$freespace = $disk.FreeSpace;

$percentFree = [Math]::Round(($freespace / $size) * 100, 2);
$sizeGB = [Math]::Round($size / 1073741824, 2);
$freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);

$colour = "Green";
if($percentFree -lt $percentWarning)
{
$colour = "Red";
}
Write-Host -ForegroundColor $colour "$server $deviceID percentage free space = $percentFree";
Add-Content "$Env:USERPROFILE\\Desktop\SUBHAG\POWERSHELL\POWERSHELL\server disks $datetime.txt" "$server,$deviceID,$sizeGB,$freeSpaceGB,$percentFree";
}
}

Change Account Expiry for Bulk Users ?


----------------------------------------------------------------------------------------------------------
Create a file SAMID.txt and put all the account name in it and execute the command from the current directory

for /f %C in (SAMID.txt) do dsquery user -samid %C | dsmod user -acctexpires

Ex. Today 29-May-2012 and extension has to be done upto 30-JUNE-2012,
Then the no. of days will be 30+3=33

------------------------------------------------------------------------------------------------------------

How to Find a Email address of all the members of Security Group ?


dsquery group -name | dsget group -members | dsquery user -limit 0| dsget user -email

Tuesday, May 29, 2012

How to set AD User ID Account Expiry for Bulk Users

Create a file SAMID.txt and put all the account name in it and execute the command from the current directory.


for /f %C in (SAMID.txt) do dsquery user -samid %C dsmod user -acctexpires



Ex. Today 29-May-2012 and extension has to be done upto 30-JUNE-2012,

Then the no. of days will be 30+3=33

Thursday, November 10, 2011

TCP/IP missing in the network adapter.

Problem Solution:
The problem was due to N/W entries of registry corruption.
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then delete the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\Config
3. If your server is a domain controller, go to step 5. (This includes servers that are running Windows Small Business Server 2003.) If your server is not a domain controller, delete the following registry subkeys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Adapters\ {GUID}
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{GUID}
4. Click Start, click Run, type sysdm.cpl, and then click OK.
5. In the Systems Properties dialog box, click the Hardware tab, and then click Device Manager.
6. In Device Manager, expand Network adapters, right-click the network adapter that you want, and then click Uninstall.
7. Restart the computer.
8. Reassign the IP address and Restart the System.
Reference:
http://support.microsoft.com/kb/937056
http://forums.techarena.in/windows-server-help/20016.htm