Archive for the ‘Admins’ Category

How to create an cmd script in Excell

31/01/2011

In excell paste in one column let sy computer names and in second column command, wich you want to script in foloving sintax =CONCATENATE(“ping “;A1;” -n 1″)

Than copy that in whole second columen paste, and script is done… copy paste in .cmd and start it.

Linux delete folder if Directory not empty

31/01/2011
To remove a folder together with everything in it, use
rm -rf /path/to/folder
or
rm -rf ./folder
with root or sudo
and becareful …… this erases files without asking anything….

Scripting help – some help for scripting in windows

29/09/2010

Scripting help

Excel

=CONCATENATE(“ping “;A19;” -n 1″)

Command Prompt:

SpyBot 1.4
spybotsd.exe /taskbarhide /autoupdate /autocheck /autoimmunize /autoclose

Hide Server
net config server /hidden:yes|no

Sophos 5.x Uninstall
msiexec.exe /X{09C6BF52-6DBA-4A97-9939-B6C24E4738BF} /q RebootYesNo=”No” Reboot=”Suppress”
msiexec.exe /X{C12953C2-4F15-4A6C-91BC-511B96AE2775} /q
msiexec.exe /X{FF11005D-CBC8-45D5-A288-25C7BB304121} /q
start psexec -i \\PC1 (ime .cmdja lokalno)c:\un-3.cmd

Disk ClenUp wizard
REM cleanmgr /sageset:1 “Nastaviš reg key, kaj pucati”
REM cleanmgr /sagerun:1 /d c: “Zaženeš po reg keyu ki si ga nastavil”

Ad-Aware 6.0
REM The parameters have the following function:
REM +A: perform all automatically (scan, remove and clean)”
REM +S: Silent mode, minimize aaw during the operation”
REM +0: don’t use in-depth scan”
REM +1: use in-depth scan”
REM if neither +0 nor +1 is used, the last user setting will be used.”
REM NOTE: to send parameters to an already running instance, add the +SD parameter”
start C:\Progra~1\lavasoft\ad-awa~1\Ad-Aware.exe “C:\” +S +A +1

Aida32 Report
aida32 /R c:\windows\$HOSTNAME /CSV /SILENT

Add local user
NET USER Bostjan Password. /ADD /fullname:”Boštjan Kavčič” /passwordchg:no

Add domain user
dsadd user CN=uporabnik,CN=Users,DC=elmo,DC=local -samid logon_name -fn Ime -ln Priimek -upn mailbox@domain.local -pwd Password.

List of computer accounts
REM ipis NB imen računalnikov iz AD (“BOSTJANKA”):
dsquery computer -scope subtree -limit 500 -o rdn
REM izpis FQDN imen računalnikov iz AD (“CN=BOSTJANKA,OU=Domain Computers,DC=atlantis,DC=local”):
dsquery computer -scope subtree -limit 500

Set Network
netsh interface ip set address name=”Internet” source=static addr=194.249.55.227 mask=255.255.255.128
netsh interface ip set address name=”Internet” gateway=194.249.55.227 gwmetric=1
netsh interface ip set dns name=”Internet” source=static addr=193.2.1.66 register=primary
netsh interface ip add dns name=”Internet” addr=193.2.1.72 index=2

Setup MSDE
C:\sql2ksp3\MSDE\setup.exe INSTANCENAME=MSDE3 SAPWD=”Password.”

Move Trend Micro OfficeScan Client
REM program, -s server, -p srv. port, -m HTTP=1 FILE=0, -c cli. port
\\slugec\ofcscan\Admin\Utility\IpXfer\IpXfer.exe -s slugec.home.local -p 8080 -m 1 -c 33389

REM cmd start to tekst file
@echo off
dir *.* > Log.txt

Logon script
net use s: \\streznik\skupno
net use h: \\streznik\uporabniki\%username%

Linux add user
useradd username -d /home/userhome -p Password.
usermod username -U

Windows Registry Editor Version 5.00

IE more than 2 concurent connections to site
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
“MaxConnectionsPerServer”=dword:00000009
“MaxConnectionsPerl_OServer”=dword:00000009

Remote Enable RDP
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnection 1 to 0

MSN Proxy
[HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger]
“ProxyState”=hex:00,00,00,00

[HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger]
“ProxyState”=hex:ff,ff,ff,ff

IE Proxy
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
“ProxyEnable”=dword:00000000
“AutoConfigURL”=”http://10.114.70.15/proxy.pac”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
“AutoConfigURL”=””
“ProxyEnable”=dword:00000001
“ProxyServer”=”proxy:8080”
“ProxyOverride”=”10.10.*;*.atlantis.local;<local>”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
“AutoConfigURL”=””
“ProxyEnable”=dword:00000000

VBScript 1.
Install network printer
‘ VBScript.’ Guy Thomas February 2004.
http://computerperformance.co.uk

‘ Purpose of script to create a local printer
‘ ******************************

Dim net
Set net = CreateObject(“WScript.Network”)
net.AddWindowsPrinterConnection “\\elmodc\hp4000n”

VBScript 2.
Hotel first start script

Enabling NLA – Network Level Authentication on Windows XP Service Pack 3 for access to Server 2008 via Remote Desktop

29/09/2010

When connecting to a Windows 2008 Server using remote desktop from a Windows XP client running service pack 2 or earlier, you get the following error message:

The remote computer requires Network Level Authentication, which your computer does not support.

To enable NLA in XP machines; first install XP SP3, then edit the registry settings on the XP client machine to allow NLA

• Configure Network Level Authentication

1. Click Start, click Run, type regedit, and then press ENTER.
2. In the navigation pane, locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
3. In the details pane, right-click Security Packages, and then click Modify.
4. In the Value data box, type tspkg. Leave any data that is specific to other SSPs, and then click OK.
5. In the navigation pane, locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders
6. In the details pane, right-click SecurityProviders, and then click Modify.
7. In the Value data box, type credssp.dll. Leave any data that is specific to other SSPs, and then click OK.
8. Exit Registry Editor.
9. Restart the computer.

source:

https://support.soundenterprises.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=221

How to add Windows CA SSL to FileZilla Server

29/09/2010

You will need to use something like openssl to generate a Certificate Signing Request first. For Windows users you can install it on FileZilla server from here: Win32 OpenSSL v1.0.0a Light and also need Visual C++ 2008 Redistributables.

– Create personal key: openssl genrsa -out host.key 1024
– Create CSR file: openssl req -new -nodes -key host.key -out host.csr
On your CA just browse to http://localhost/certsrv/, select Request a Certificate, then Submit a certificate request file (open with notepad and copy/paste) using a base-64 encoded PKCS #10 file. The web form gives you the option to select a template to use – web server, and then download certificate (.cer) and certificate chain (.p7b)
– Open .cer, from Details click Copy to File, select  Base-64 and save it to host.cer
Open .p7b and export root certificate in Base-64 format to root.cer
– copy host.key + host.cer + root.cer host_fz.crt

Now you have host_fz.crt for File Zilla FTPS

That work for me.

 

How to open range of ports on Windows XP / 2003 Firewall

30/12/2009

Manually opening range of port can be very painful if you must open a big range of ports. It can be easily done with the following script from command prompt:

FOR /L %I IN (5000,1,5010) DO netsh firewall add portopening TCP %I “Passive FTP”%I

This will open ports from 5000 to 5010.

FOR /L %I IN (5000,1,5010) DO netsh firewall delete portopening TCP %I

Thiss will close ports from 5000 to 5010.

Vmware ESX NFS datastore on Windows Server 2008

23/12/2009

So if this is the need for slow file transfers, you can do it that way:

1. Install Services for Network File System (NFS)
Server Manager – Add Roles – File Services – Services for Network File System

2. Edit Local policy(or GPO) to Everyone permissions apply to anonymous users
Administrative tools – Local Security Policy – Local Policies – Security Options – Network Access: Let Everyone permissions apply to anonymous users – Enabled
GPO – Computer Configuration – Policies – Windows Settings – Security Settings – Local Policies – Security Options – Network Access – Network Access: Let Everyone permissions apply to anonymous users – Enabled

3. set NFS to TCP only
Administrative tools – Services for Network File System (NFS) – Server for NFS Properties – Transport protocol to TCP only (default is TCP+UDP)
Reboot server!

4. Create Share and set IP access
Open Folder Properties – NFS Sharing – Manage NFS Sharing – select Share this folder – select Allow anonymous access – set Anonymous UID and Anonymous GID to 0 – Permissions – Add VMKernel IP to Add names, leave read-write, select Allow root access – ok – ok – ok – ok

5. Set datastore on esx server
Go to service console and type: esxcfg-nas -a -o (Windows 2008 IP) -s /(sharename) (datastore_name)

… and now can cpoy ISO images and backup files betwen esx and windows. For virtual machine running you beter to buy dedicated NAS or SAN system.

My first

09/12/2009

First time write this. I was strict against that type of losing time, but… Now I find this useful for paste somewhere some tricks that I learn on work.