Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 8

Sample of Net View command

11Comments more +

Email Print Add to Favorites Del.icio.us Digg Hacker News LinkedIn eddit !ec"norati

#$ #rien %. Pose$ %C&E Fe'ruar$ () *++1) ,-++am P&! I. $ou/ve read man$ o. m$ Dail$ Drill Downs) $ou/ve 0ro'a'l$ noticed t"at I tend to use t"e command 0rom0t e1cessivel$. Alt"oug" I/ve o.ten 'een ridiculed .or using t"e command 0rom0t in a gra0"ical environment) commands do "ave t"eir 0lace. 2ne o. t"e 'iggest uses .or commands is in 'atc" .iles. 3ou can use 'atc" .iles to automate certain network4related tasks. 2. course) doing so would 'e ver$ di..icult) i. not im0ossi'le) i. $ou were limited to t"e 'asic D2& command set. Fortunatel$) 5indows N! &erver and 5indows *+++ &erver 0rovide an e1tended set o. commands $ou can use to automate network4related tasks. 2ne suc" command is t"e Net command. In t"is Dail$ Drill Down) I/ll discuss t"e Net command. I/ll also s"ow $ou w"at t"e Net command can 'e used .or and e10lain t"e s$nta1 'e"ind its various uses. 5"at is t"e Net command6 #e.ore $ou can understand w"at t"e Net command is) $ou must understand a little 'it a'out t"e wa$ t"at networks used to work. In t"e da$s o. D2& and 5indows 7.1 8not 5indows .or 5orkgrou0s9) 5indows "ad ver$ little 'uilt4in network su00ort. !"e ma:orit$ o. t"e network .unctions "ad to 'e 0er.ormed at t"e D2& level. A t$0ical 0rocess was to load t"e network redirector t"roug" t"e Autoe1ec.'at .ile. 2nce t"e redirector was loaded) t"e user could interact wit" t"e network. !"is is w"ere t"e Net command came into 0la$. !"e Net command was 'asicall$ a single command t"at could 'e used to accom0lis" a wide variet$ o. network4 related tasks) suc" as logging in or ma00ing a network drive. 2ver t"e $ears) t"e Net command "as 'ecome o'solete .or an$t"ing ot"er t"an automation 0ur0oses. Almost ever$ task t"at can 'e 0er.ormed t"roug" t"e Net command can also 'e accom0lis"ed t"roug" t"e ;ra0"ical <ser Inter.ace 8;<I9. In s0ite o. t"is .act) t"e Net command "as evolved over t"e $ears. E1tra .unctionalit$ "as 'een added to t"e command) and t"e Net command is still su00orted to t"is da$. Now t"at $ou know t"e "istor$ o. t"e Net command and some o. its uses) let/s e1amine t"e command in detail. In t"e sections t"at .ollow) I/ll discuss eac" o. t"e Net command/s

.unctions. !"e Net command is alwa$s a two40art command. !"e Net commands $ou can issue include t"e .ollowing Net Accounts Net Com0uter Net Con.ig Net Continue Net File Net ;rou0 Net Hel0 Net Hel0msg Net Localgrou0 Net Name Net Pause Net Print Net &end Net &ession Net &"are Net &tart Net &tatistics Net &to0 Net !ime Net <se Net <ser Net =iew Net Accounts !"e Net Accounts command 0rovides a met"od .or dis0la$ing t"e account 0olicies .or t"e domain. 3ou can see a sam0le o. t"e Net Accounts command "ere.
Z:\USERS\Administrator>net accounts Force user logoff how long after time expires?: "inimum password age #da$s%: "aximum password age #da$s%: "inimum password length: 'ength of password histor$ maintained: 'oc(out threshold: 'oc(out duration #minutes%: 'oc(out o*ser!ation window #minutes%: +omputer role: .rimar$ domain controller for wor(station domain: 1he command completed successfull$2 e!er & Unlimited & one e!er )& )& ,A+-U. \\S+//,0

Net Com0uter !"e Net Com0uter command allows $ou to add a com0uter account to or remove a com0uter account .rom a domain. 5"at/s cool a'out t"is command is t"at i. $ou "ave a list o. com0uter account names) $ou could write a sim0le 'atc" .ile to add or remove t"ose account names. 3ou can see a sam0le o. t"e Net Com0uter command/s .unctionalit$ "ere.
Z:\USERS\Administrator>net computer 1he s$ntax of this command is: E1 +/".U1ER \\computername 34A55 6 45E'7 Z:\USERS\Administrator>net computer \\homer 4add 1he re8uest will *e processed at the primar$ domain controller for domain

,U52 1he command completed successfull$2

Net Con.ig %an$ times w"en I/ve 'een working on someone else/s com0uter) I/ve needed to know t"e 'asic settings) suc" as t"e com0uter name) t"e workgrou0 name) and t"e name o. t"e user w"o/s logged in. !"e Net Con.ig command 0rovides a >uick and eas$ wa$ to ac>uire t"is in.ormation. In a 5indows (, or 5indows %e environment) t"e Net Con.ig command dis0la$s t"e t$0e o. in.ormation s"own 'elowC-?5IND25&@net con.ig Com0uter name ??!AA <ser name AD%INI&! A!2 5orkgrou0 #<D 5orkstation root director$ C-?5IND25& &o.tware version B.(+.7+++ edirector version B.++ !"e command was com0leted success.ull$. !"e Net Con.ig command also works in 5indows N!. !"e main di..erence is t"at $ou "ave to s0eci.$ w"et"er $ou want to dis0la$ a summar$ o. a server or a workstation. For e1am0le) $ou/d enter Net Config Workstation. 3ou/d t"en see a summar$ similar to t"e one given in 5indows %e 'ut wit" slig"tl$ more detail. Net Continue 3ou use t"e Net Continue command to restart a service t"at "as 'een 0aused '$ a Net Pause command. !"e s$nta1 .or t"e command is C-?5indows@net continue service w"ere service is t"e name o. t"e service $ou 0aused. Net File Need to .ind out w"o/s using .iles on $our server6 Cust use t"e Net File command. As $ou can see "ere) t"e Net File command 0rovides $ou wit" a >uick summar$ o. w"ic" users are attac"ed and "ow man$ .iles t"e$ "ave locked.
Z:\USERS\Administrator>net file 95 .ath User name : 'oc(s ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ) <:\USERS\Administrator Administrator & = <:\USERS\Administrator Administrator & >= \.9.E\samr & 1he command completed successfull$2

Net ;rou0 !"e Net ;rou0 command allows $ou to dis0la$ all o. t"e grou0s t"at e1ist wit"in a domain. 3ou can see a sam0le o. t"is command "ere.
Z:\USERS\Administrator>net group ?roup Accounts for \\191A 9U" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @5omain Admins @5omain ?uests @5omain Users @Finance @"1S 1rusted 9mpersonators@test group @ZZZZ 1he command completed successfull$2

Net Hel0 !"e Net Hel0 command gives $ou detailed in.ormation on a Net command. !o use it) :ust t$0e net help command) w"ere command is t"e name o. t"e command $ou want "el0 wit". Net Hel0msg I. 5indows *+++ "as a 0ro'lem) it o.ten coug"s u0 con.using error messages and num'ers. 3ou can use t"e Net Hel0msg command to tr$ to .ind out w"at t"e error messages mean. Cust t$0e Net Helpmsg errornumber) w"ere errornumber is t"e error t"at 5indows *+++ "as given $ou. Net Localgrou0 Cust as t"e Net ;rou0 command dis0la$s all o. t"e domain/s grou0s) t"e Net Localgrou0 command dis0la$s a list o. t"e grou0s t"at are s0eci.ic to t"e local com0uter. Here/s a sam0le o. t"e Net Localgrou0 command.
Z:\USERS\Administrator>net localgroup Aliases for \\191A 9U" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @Account /perators @Administrators @,ac(up /perators @?uests @"1S 9mpersonators @.rint /perators @Replicator @Ser!er /perators @Users 1he command completed successfull$2

Net Name 3ou can use t"e Net Name command to control t"e name o. t"e server w"en it sends and receives messages online. I. $ou use t"e command '$ itsel.) $ou can see t"e current names con.igured .or $our com0uter. 3ou can add or delete names '$ using t"e DADD and DDELE!E switc"es) res0ectivel$. Net Pause !"e Net Pause command 0auses services running on $our server. It can 'e use.ul i. $ou need to 0ause a service to trou'les"oot or make c"anges to it. !o use it) :ust t$0e Net Pauseservice) w"ere service is t"e name o. t"e service $ou want to 0ause. Net Print I can/t count t"e num'er o. times I/ve needed to add 0rinting ca0a'ilities to a 'atc" .ile. In older versions o. 5indows) network 0rinting .rom a 'atc" .ile usuall$ meant using t"e Net <se command to ca0ture a 0rinter 0ort and t"en 0rinting to t"e ca0tured 0ort. <n.ortunatel$) t"is tec"ni>ue can cause con.usion .or end users t"e ne1t time t"e$ tr$ to 0rint 'ecause t"e$ ma$ "ave alread$ 'een using t"e 0rinter 0ort t"at t"e 'atc" .ile reassigned. I. $our users are working in a 5indows (,) %e) or N! environment) t"e Net Print command is a good alternative to traditional 'atc"4.ile 0rinting. !"e Net Print command allows $ou to send 0rint :o's to a network 0rinter wit"out ca0turing an LP! 0ort. 3ou can see t"e s$nta1 .or t"e Net Print command "ere.
Z:\USERS\Administrator>net print 1he s$ntax of this command is: E1 .R9 1 \\computername\sharename A\\computernameB Co*: A4</'5 6 4RE'EASE 6 45E'E1EB

Net &end !"e Net &end command can 'e used to send a 0o04u0 message to network users. Cust enter t"e

username and t"e message. As $ou can see in t"is sam0le) t"e command also o..ers t"e ca0a'ilit$ to send messages to users in anot"er domain.
Z:\USERS\Administrator>net send 1he s$ntax of this command is: E1 SE 5 3name 6 @ 6 45/"A9 A:nameB 6 4USERS7 message Z:\USERS\Administrator>net send Administrator 1his is a test 1he message was successfull$ sent to A5"9 9S1RA1/R2

Net &ession !"e Net command can even 'e used to see w"ic" com0uters are attac"ed to $our com0uter. &im0l$ enter t"e Net &ession command) and $ou/ll see a summar$) similar to t"is one.
Z:\USERS\Administrator>net session +omputer User name +lient 1$pe /pens 9dle time ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; \\1AZ"A 9A Dindows E&&& E>FG> &>5 >&< H=" \\191A 9U" Dindows 1 >)I> & >>5 &&< HE" \\191A 9U" Administrator Dindows 1 >)I> E &&:&&:&& 1he command completed successfull$2

Net &"are I. $ou/d like to see w"ic" s"ares e1ist on a PC) $ou can do so '$ using t"e Net &"are command. 3ou can see a sam0le o. t"is command "ere.

Share name Resource Remar( ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +J +:\ 5efault share A5"9 J +:\D9 1 Remote Admin RE.'J +:\D9 1\S$stem)E\Repl\Export 9.+J Remote 9.+ <J <:\ 5efault share FJ F:\ 5efault share printJ +:\D9 1\S$stem)E\spool\5R9KERS .rinter 5ri!ers dfs F:\dfs homeLser!er F:\homeLser!er "icrosoft UA" Kolume F:\"icrosoft UA" Kolume E1'/?/ +:\D9 1\S$stem)E\Repl\9mport\S 'ogon ser!er share titanium F:\titanium USERS <:\USERS HS9"M '.1>: Spooled "ar(eting HS9"ME '.1>: Spooled "anagement HS9"M) '.1>: Spooled Finance 1he command completed successfull$2

Net &tart !"is command starts an$ o. t"e various services t"at are running. 3ou can also use t"e Net Pause or Net Continue command to 0ause or resume services. Net &tatistics Per"a0s one o. t"e most use.ul Net commands is Net &tatistics. !"e Net &tatistics command 0rovides some "ard4core statistics on "ow a server or workstation is communicating across t"e network. !"is command merel$ re>uires $ou to .ollow t"e Net &tatistics command wit" t"e word Server or Workstation) as s"own "ere.
Z:\USERS\Administrator>net statistics wor(station Dor(station Statistics for \\191A 9U" Statistics since >E4>4&& =:EN A" ,$tes recei!ed HIIGF&F Ser!er "essage ,loc(s #S",s% recei!ed G>GE&

,$tes transmitted Ser!er "essage ,loc(s #S",s% transmitted Read operations Drite operations Raw reads denied Raw writes denied etwor( errors +onnections made Reconnections made Ser!er disconnects Sessions started <ung sessions Failed sessions Failed operations Use count Failed use count 1he command completed successfull$2

=>&>&E& G>GE) E) >>FF & & & EH)) > = EIEH & & ) )E>E EIG

Net &to0 !"is command is t"e o00osite o. Net &tart. As $ou can 0ro'a'l$ guess) t"is command sto0s services .rom running on $our server. Net !ime 2ne o. t"e commands t"at I/ve 0ersonall$ .ound ver$ use.ul is t"e Net !ime command. !"e Net !ime command is used to s$nc"roniEe t"e time on a workstation wit" t"e time on a server. Here/s t"e s$nta1 .or t"e Net !ime commandNE! !I%E F??com0uter G D52 H; 2<P-wgnameI FD&E!I FD3E&I com0uterJ&0eci.ies t"e name o. t"e com0uter 8time server9 w"ose time $ou want to c"eck or s$nc"roniEe $our com0uterKs clock wit". D52 H; 2<PJ&0eci.ies t"at $ou want to use t"e clock on a com0uter 8time server9 in anot"er workgrou0. wgnameJ&0eci.ies t"e name o. t"e workgrou0 containing a com0uter w"ose clock $ou want to c"eck or s$nc"roniEe $our com0uterKs clock wit". I. t"ere are multi0le time servers in t"at workgrou0) NE! !I%E uses t"e .irst one it .inds. D&E!J&$nc"roniEes $our com0uterKs clock wit" t"e clock on t"e com0uter or workgrou0 $ou s0eci.$. D3E&JCarries out t"e NE! !I%E command wit"out .irst 0rom0ting $ou to 0rovide in.ormation or con.irm actions. Net <se 5it"out a dou't) t"e most 0ower.ul Net command in an$ version o. 5indows is t"e Net <se command. !"e Net <se command is used to attac" to resources suc" as network s"ares or 0rinters. For e1am0le) to ma0 t"e L- drive to a s"are called Articles on a server called !aEmania) $ou could enter t"e .ollowing commandNet <se L- ??!aEmania?Articles Likewise) $ou could ma0 LP!1 to a network 0rinter t"at/s attac"ed to a server called &coo'$ and s"ared as HP '$ entering t"e .ollowing commandNet <se LP!1- ??&coo'$?HP !"e Net <se command also 0rovides mec"anisms .or removing connections t"at $ou/ve made and .or entering 0asswords. Here/s a .ull summar$ o. t"e Net <se s$nta1.

+:\D9 5/DS>net use 4? +onnects or disconnects $our computer from a shared resource or displa$s information a*out $our connections2 E1 USE Adri!e: 6 @B A\\computer\director$ Apassword 6 ?BB A4SAKE.D: /B A40ESB A4 /B E1 USE Aport:B A\\computer\printer Apassword 6 ?BB A4SAKE.D: /B A40ESB A4 /B E1 USE dri!e: 6 \\computer\director$ 45E'E1E A40ESB E1 USE port: 6 \\computer\printer 45E'E1E A40ESB E1 USE @ 45E'E1E A40ESB E1 USE dri!e: 6 @ 4</"E dri!e Specifies the dri!e letter $ou assign to a shared director$2 @ Specifies the next a!aila*le dri!e letter2 9f used with 45E'E1EO specifies to disconnect all of $our connections2 port Specifies the parallel #'.1% port name $ou assign to a shared printer2 computer Specifies the name of the computer sharing the resource2 director$ Specifies the name of the shared director$2 printer Specifies the name of the shared printer2 password Specifies the password for the shared resourceO if an$2 ? Specifies that $ou want to *e prompted for the password of the shared resource2 0ou donPt need to use this option unless the password is optional2 4SAKE.D: / Specifies that the password $ou t$pe should not *e sa!ed in $our password;list file2 0ou need to ret$pe the password the next time $ou connect to this resource2 40ES +arries out the E1 USE command without first prompting $ou to pro!ide information or confirm actions2 45E'E1E ,rea(s the specified connection to a shared resource2 4 / +arries out the E1 USE commandO responding with / automaticall$ when $ou are prompted to confirm actions2 4</"E "a(es a connection to $our </"E director$ if one is specified in $our 'A "anager or Dindows 1 user account2

!o list all o. $our connections) t$0e NET USE wit"out o0tions. !o see t"is in.ormation one screen at a time) t$0e t"e .ollowing at t"e command 0rom0tNE! <&E D6 G %2 E or NE! HELP <&E G %2 E Net <ser Anot"er use .or t"e Net command is viewing all o. t"e user accounts t"at e1ist on a given mac"ine. !o do so) sim0l$ enter t"e Net <ser command) as s"own "ere.
Z:\USERS\Administrator>net user User accounts for \\191A 9U" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Admin Administrator ,ill$L,rown ,rien ,rienL.ose$ ?uest

9USRLS+//,0 9USRL1A'A9 9A 9DA"LS+//,0 9DA"L1A'A9 9A Qerem$L,ro$les -endallL<ensle$ ormal Rep ShamirL5asgupta 1alainiaL.ose$ 1est 1he command completed successfull$2

9USRL191A 9U" 9DA"L191A 9U" "igrate Shamir 1aR

Net =iew !"is command dis0la$s t"e ot"er com0uters t"at are visi'le on t"e network. 3ou can see a sam0le o. Net =iew/s out0ut "ere.
Z:\USERS\Administrator>net !iew Ser!er ame Remar( ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; \\S+//,0 \\1A'A9 9A \\1AZ ,R9E \\1AZ"A 9A \\191A 9U" 1he command completed successfull$2

Conclusion In t"is Dail$ Drill Down) I e10lained "ow $ou can use t"e Net command to automate man$ common network tasks. As I did) I outlined t"e s$nta1 used .or eac" t$0e o. task. !"e aut"ors and editors "ave taken care in 0re0aration o. t"e content contained "erein 'ut make no e10ressed or im0lied warrant$ o. an$ kind and assume no res0onsi'ilit$ .or errors or omissions. No lia'ilit$ is assumed .or an$ damages. Alwa$s "ave a veri.ied 'acku0 'e.ore making an$ c"anges.

You might also like