Beruflich Dokumente
Kultur Dokumente
ICTNWK409
Create scripts for networking
INTRODUCTION TO SCRIPTING
Accessing Command Line
Access to the command line can be from the run window by typing “cmd” or accessing the
command prompt from the start menu.
Getting Help
Whilst in the command window type the word “help” this will display a list of available commands
Creating a subdirectory
The following command “md” or “mkdir” (make directory) is used to create a sub-directory or
sub-folder the example below is creating the documents directory or folder as a sub directory of
the student directory or folder on the root of C: drive.
md c:\student\documents
Directory listing
The following command “dir” is used to provide a directory listing of the existing directories or
folders, the output will be displayed on the computer screen.
dir c:\student
Removing a directory
The following command “rd” or “rmdir” (remove directory) is used to delete a directory or folder
the example below is deleting the student directory or folder on the root of C: drive.
rd c:\student
Example:
copy c:/movies/logan.mkv d:/mymovies/logan.mkv
(this command copies a single file from the movies folder to the subfolder of
xmen with the movies folder leaving the original file in place)
Example:
netdom renamecomputer randomename /newname:server
Example:
netdom computername server /add: server.lidcombe-it.local
netdom computername server /MakePrimary server.lidcombe-it.local
Sharing folders on the local computer and sharing permissions (multiple users/groups)
net share mymovies=c:\movies /grant:group1,read /grant:group2,change
POWERSHELL COMMANDS
Change IP Address
New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address “192.168.0.1”
–PrefixLength 24 -DefaultGateway 192.168.0.254
-DynamicUpdate "NonsecureAndSecure"
Adding a user account object to Active Directory with multiple group memberships
dsadd user “cn=LTorvalds, ou=finance, dc=lidcombe-it, dc=local” –samid ltorvalds –fn Linus –ln
Torvalds –pwd P@55word –memberof “cn=finance users, ou=finance, dc=lidcombe-it, dc=local”
“cn=finance managers, ou=finance, dc=lidcombe-it, dc=local”