Archive for the 'Windows' Category

C# AD search

January 21st, 2010 | Category: Windows

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
// Bind to the container to enumerate.
DirectoryEntry ent = new DirectoryEntry(”LDAP://OU=Users,DC=Domain,DC=local”);
// Create an object to use for individual objects in the container and iterate
// through the container.
foreach (DirectoryEntry child in ent.Children)
{
// Write the name and path for each object in the container.
Console.WriteLine(”{0} {1}”, child.Name, child.Path);
}

}
catch
{
// Handle errors.
}

}
}
}

No comments

netsh

November 26th, 2009 | Category: IT, Windows

Configure TCP/IP from the Command Prompt

by Daniel Petri - January 7, 2009

In order to configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe.

Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer. Netsh.exe can also save a configuration script in a text file for archival purposes or to help you configure other servers.

Netsh.exe is available on Windows 2000, Windows XP and Windows Server 2003.

You can use the Netsh.exe tool to perform the following tasks:

  • Configure interfaces
  • Configure routing protocols
  • Configure filters
  • Configure routes
  • Configure remote access behavior for Windows-based remote access routers that are running the Routing and Remote Access Server (RRAS) Service
  • Display the configuration of a currently running router on any computer
  • Use the scripting feature to run a collection of commands in batch mode against a specified router.

What can we do with Netsh.exe?

With Netsh.exe you can easily view your TCP/IP settings. Type the following command in a Command Prompt window (CMD.EXE):

netsh interface ip show config

With Netsh.exe, you can easily configure your computer’s IP address and other TCP/IP related settings. For example:

The following command configures the interface named Local Area Connection with the static IP address 192.168.0.100, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:

netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1

(The above line is one long line, copy paste it as one line)

Netsh.exe can be also useful in certain scenarios such as when you have a portable computer that needs to be relocated between 2 or more office locations, while still maintaining a specific and static IP address configuration. With Netsh.exe, you can easily save and restore the appropriate network configuration.

Now, you need to export your current IP settings to a text file. Use the following command:

netsh -c interface dump > c:'location1.txt

When you reach location #2, do the same thing, only keep the new settings to a different file:

netsh -c interface dump > c:'location2.txt

You can go on with any other location you may need, but we’ll keep it simple and only use 2 examples.

Now, whenever you need to quickly import your IP settings and change them between location #1 and location #2, just enter the following command in a Command Prompt window (CMD.EXE):

netsh -f c:'location1.txt

or

netsh -f c:'location2.txt

and so on.

You can also use the global EXEC switch instead of -F:

netsh exec c:'location2.txt

Netsh.exe can also be used to configure your NIC to automatically obtain an IP address from a DHCP server:

netsh interface ip set address "Local Area Connection" dhcp

Would you like to configure DNS and WINS addresses from the Command Prompt? You can. See this example for DNS:

netsh interface ip set dns "Local Area Connection" static 192.168.0.200

and this one for WINS:

netsh interface ip set wins "Local Area Connection" static 192.168.0.200

Or, if you want, you can configure your NIC to dynamically obtain it’s DNS settings:

netsh interface ip set dns "Local Area Connection" dhcp

BTW, if you want to set a primary and secondary DNS address, add index=1 and index=2 respectively to the lines of Netsh command.

As you now see, Netsh.exe has many features you might find useful, and that goes beyond saying even without looking into the other valuable options that exist in the command.

No comments

ftp commands

November 02nd, 2009 | Category: IT, Mac, Windows

ls: directory listing equivalent to dir.
ls -l: long directory listing, more detail.
pwd: display the name of current directory.
cd: change directory.
lcd: change the local current directory.
get: to download the file from the FTP server.
put: to transfer file and place it on the FTP server.
mget: to download multiple files from the FTP server.
mput: to transfer multiple files to the FTP server.
prompt: to turn on/off interactive mode.
binary: to turn on binary mode.
ascii: to turn on ascii mode.
delete: to turn a file on FTP server.
status: to display how the current FTP session is configured.
mkdir: to make directory on FTP server.
quit/close/bye/disconnect: to disconnect from the FTP server.

No comments

Active Directory Users and Computers - MMC - View

January 15th, 2009 | Category: IT, Windows

Szeretnék megosztani egy viszonylag hasznos információt azokkal akik dolgoznak Windows szerverekkel. Az én esetemben Windows Server 2003 R2 SP2 x64 english verzióról van szó. Egyszer egy kollégém az egyik (A) user objektumál elhelyezett az ‘Environment’ alatt ‘Start the following program at logon’ c. bejegyzéshez egy információt, hogy ez mire való azt nem részletezném. Egyik alkalommal szükség volt egy hasonlóan működő (B) user elkészítésére, hogy bejelentkezéskor induljon el az a program ami az (A) usernél is elindul. Le is másoltam a usert, de a program el nem indult, és semmilyen GPO, vagy logon file nem irányult az adott felhasználóra ami szabályozta volna a program indulását. A két user objektumot összehasonlítva sem találtunk eltérést, míg nem bekapcsoltam az ‘Advanced Features’ nézet módot. Ott összehasonlítva látszott csak az eltérés. A user copyval nem másolódott az ‘Environment’ fül alatti bejegyzés, mitöbb normál nézetben nem is látszott ott semmilyen bejegyzés. Így derült fény arra, hogy az (A) user esetében az itt található bejegyzés miatt indult el egy bizonyos alkalmazás bejelentkezéskor.

No comments

MCP 70-291/293 » MCSA

December 21st, 2008 | Category: IT, Windows

IPv4 | IPv6 | DHCP | DNS | AD | FQDN | VPN | IPSec | Routing | Firewall | RRAS | IIS | DHCP Relay | L2TP | PPTP | Dial-In | LAN | CA | WINS | NETBIOS | GPO | Network Monitoring | MAC | SSL | HTTPs | PTR | Kerberos | MD5 |  EAP | CHAP | NAT | RIPv2 | OSPF | Scope | OU | RSoP | CName ¬ avagy:

…két hétvégén szombat-vasárnap résztvettem egy Microsoft MCP tanfolyamon, melyen a Network témakörön belül bővítették tudásom. Oly annyira tetszett a tanfolyam, és rájöttem, hogy elég sok mindennel tisztában vagyok már; elhatároztam, hogy megszerzem az MCSA képesítést (Microsoft Certified System Administrator - Microsoft által Minősített Rendszer Adminisztrátor). Az MCSA képesítést 4 MCP vizsga letételével lehet megszerezni, ezek közül a Networking-el a 70-291 vizsga fogalalkozik. A 70-293 már az MCSE része (Microsoft Certified System Engineer - Microsoft által Minősített Rendszermérnök), az MCSE MCSA+3 MCP, természetesen ez már a vizsgadíjak miatt sem olcsó. Szerencsére a két modul 70-291/293 elég közell ál egymáshoz, így egymás után tervezem őket letenni, annak ellenére, hogy MCSE képesítés hosszú távú terveim között szerepel csak.

No comments

Vista #1.1

April 24th, 2008 | Category: Windows


amit ígértem be is tartom…

szektor hibával elszált a particionáló program. pont. vista & xp install alatt 3 partíció volt látható de mégse lehetett egyikre se se telepíteni se kezelni őket, majd MiniPe boot-os windows klónra installált csomó disc kezelő alkalmazások közül az egyikkel sikerült a partíciókat normálisan elrendezni, ebből az állapotból:
+ primary (2Gb)
+ extended (100Gb)
- primary (100Gb)
+ primary (28Gb)
teljes hdd méret (160Gb) most mivan ?! :D

no mindegy vége a káosznak, ami kedves vista miatt alakult ki. ezekben a pillanatokban installálódik a pc-re a vista. éljen
ha még történik valami érdekes jelentkezek ezzel kapcsolatban :)

No comments

Vista #1

April 24th, 2008 | Category: Windows

Egy IT cégnél vagyok alkalmazott, ahol a vezetők notebookokat használnak. Minap megkérdezte az egyik, hogy mikor kaphatná meg a PC-jét, én pedig visszakérdeztem, hogy oké, de milyen operációs rendszerrel ?! Azt tudni kell, hogy a legutóbbi IT beszerzésekkor Vista Business preinstallos PC-k érkeztek. Kis ‘csata’ után a Vista mellett döntött.

Elkeztem az installt, kb. 1 óra alatt leszedtem a sok gyártó által felinstallált idióta programot, majd elérkeztünk ahhoz a részhez, hogy felezzük meg a HDD területét :) Szabad terület 137 giga lemezkezelő szerint mikor zsugorítani szerettem volna 12 giga volt, ez pedig ahhoz vezetett, hogy képtelen voltam értelmes arányban megfelezni és 2 partíciót készíteni belőle a beépített lemezekezelő segítségével. Most amikor írom ezeket a sorokat éppen Acronis disk kezelője fut… végeredményről beszámolok.

üdv

No comments