Search The Web

Sunday, March 11, 2012

stop and start network adapters in a batch file or DOS using netsh

Stop and Start Network Adapters in a Batch File or DOS using netsh.


Sometimes you may want to stop and start network adapters from a command line. This is especially true for when you want to use them in a DOS batch file.
To do this we are going to use Net Shell (netsh) which is a powerful command line based tool for managing network properties. net shells capabilities extend far beyond what we are doing here and i encourage you to investigate this further. To get a list of commands try typing " netsh /? " at a command line
netsh /? to display a list of net shell options
netsh /? to display a list of net shell options
Firstly you will want to find the name of the adapter. to do this, open Network and Sharing Center (in Win 7 and Vista) and choose Change adapter settings. Typically, the a LAN connection is named " Local Area Connection " and a wireless connection is named " Wireless Network Connection " . This can also be discerned from looking at an ipconfig read out, where for a LAN connection is will say Ethernet Adapter Local Area Connection " . if doing this remember to drop the Ethernet adapter portion of the name.
Another way to find the name is to open a DOS command and enter netsh interface show interface. The name listed in the interface name is the name of the connection. In this case was are focusing on the Wireless Network Connection
Use netsh interface  show interface  to show interface name in dos / powershell
Use netsh interface show interface to show interface name in dos / powershell
For this example we will use a wireless network adapter with the default name of "Wireless Network Connection"
The command to disable this connection is:
netsh interface set interface "Wireless Network Connection" DISABLE
netsh interface set interface " name" enable to enable interface in dos / powershell
netsh interface set interface " name" enable to enable interface in dos / powershell
to enable the adapter again, the command is:
netsh interface set interface "Wireless Network Connection" ENABLE
netsh interface set interface "<name>" enable to enable network interface is dos / powershell
netsh interface set interface "" enable to enable network interface is dos / powershell
as you can see, this would be really easy to put in a batch file to put in a start up or deploy in other methods.
for a video tutorial on this, please check the youtube video below:


This post can also be located at our sister site www.dizzyit.com at: http://wp.me/p1Zlmi-1u

Sunday, March 4, 2012

start and stop services via batch file / command prompt

start and stop services via batch file / command prompt


To start and stop services with a batch file is very easy and is useful for scheduled tasks where you may want to regularly restart a service for various reasons
Firstly, you need to know the name of the service. to locate this you go to computer management -> services and look for the name of the service you need to restart. In this case we will use the Print Spooler service.
your commands to stop the service are net stop "service name" and your command to start it are net start "service name"
so to restart as a batch file would look like"
@Echo Off
REM this will restart the prince spooler service

net stop "Print Spooler"
net start "print spooler"
exit
as usual you would want to add a remark (REM) to the start of the batch file to describe what you would like to do.
you can combine these commands for restarting complex systems such as IIS. as an exambple, this series of command will restart IIS's web, FTP and SMTP services
@Echo off
REM this restarts IIS's web, SMTP and FTP services
net stop "World Wide Web Publishing Service"
net start "World Wide Web Publishing Service"
net stop "FTP Publishing Service"
net start "FTP Publishing Service"
net stop "Simple Mail Transport Protocol (SMTP)"
net start "Simple Mail Transport Protocol (SMTP)"
so as you can see this is all pretty straight forward stuff. from here you can save the batch file and add it as a scheduled task in windows (more on that later)

Tuesday, January 17, 2012

VSphere error : Your Current security settings do not allow this file to be downloaded


VSphere error : Your Current security settings do not allow this file to be downloaded


I got this message in VSphere while trying to configure the Auto deploy feature ( specifically downloading the TFTP boot ZIP) and logically its not a VSphere issue at all.
the issue is due to IE security settings in the Internet Zone having file download disabled. to rectify just adjust this is IE:
  1. Open Internet Explorer
  2. choose tools -> internet options
  3. select the security tab
  4. select internet then custom level
  5. scroll down about half way to downloads and change the file download radio button to enable
  6. OK till your back at IE
heres the screen your looking for:

Wednesday, January 11, 2012

How to delete corrupted Windows Update Files in Windows 7

How to delete corrupted Windows Update Files in Windows 7


If you have an update file cached on  a windows 7 machine that is causing issues, or that you want to tidy up for imaging purposes,  the process is really straight forward to clean it up.
the files are located at c:\windows\C:\windows\SoftwareDistribution\download . if you delete the contents of this folder, the cached copy should no longer be an issue.

if you wanted to script this in a batch file, it could look something like this:
rmdir /s /q C:\windows\SoftwareDistribution\Download
rmdir /s /q C:\windows\SoftwareDistribution\Download
as you can see, pretty straight forward issue to a common problem!


this guide can also be found on our sister site, DizzyIT.com at: http://dizzyit.com/wp-admin/post.php?post=74&action=edit&message=1

Thursday, December 8, 2011

T01 E3B M0F errors when pxe booting in SCCM 2007


T01 E3B M0F errors when pxe booting in SCCM 2007


I had the above issues and after looking around the internet and some trial an error, this is the solution that I found:
1: Stop the WDS service.
2: Old out the  C:\WINDOWS\TEMP\PXEBootFiles\Windows folder
3: Start the WDS service.
4: Check smspxe.log again and see if Unable to delete directory... exists.

This solved my issues, and my folders in ...\SMSBoot\x86 ...\SMSBoot\x64 and ...\SMSBoot\ia64 were populated with the needed files.
seemed to work for me.

Wednesday, November 30, 2011

Extending a Share Quota in server 2008


In server 2008, you use the Share and Storage Management tool to provision shares and storage. In this tool you can create a quota for a share. this is a good idea to stop data sprawl which can occur, especially on shared drives. But what if you want to manage, extend or decrease this quota?
for some reason in their infinite wisdom, Microsoft doesn’t allow you to do so from the Share and Storage Management Tools Window. To increase the quota size:
  1. open File Server Resource Manger
  2. expand Quota Management and choose Quotas
  3. This will present all the available Quotas (known as Source Templates) that you have configured.
  4. Find the source template you want to extend, right click and choose edit quota properties
  5. From here you are shown the Quota template from which your folder pulls its settings, the specific space limitations of this share and any warnings that you have configured for out of space notifications
  6. As you an see above, I have set the Quota to be 350GB in this instance (from a 100GB template) and configured email and event log notifications (note that for email notifications to work you will need to configure SMTP in IIS)
  7. click ok and your quota has been set!
please note that this article can also be viewed at our sister site dizzyit.com at : http://dizzyit.com/2011/12/01/extending-share-quota-server-2008/

Wednesday, November 16, 2011

SCCM PXE Error after booting – The certificate associated with this media has expired


SCCM PXE Error after booting – The certificate associated with this media has expired



you boot into configuration manager and you get this message which just makes your day:
Error: the certificate associated with this media has expired. New Media with a valid certificate will need to be created.
This is pretty easy to fix assuming you have a self signed certificate. To do so:
1. Log into you SCCM server and go to Site Database → Site Management → Site Settings → Site Systemsand select the SCCM server that maintains your PXE load point
2.In the right hand side  pane, right click on the “ConfigMgr PXE service point” and choose Properties.
3. Select the Database tab and look for the the Create self-signed PXE certificate option in the lower half of the screen.
4. here you can change the date for the self signed PXE certificate to a date in the future then choose OK
5. To verify that all is now OK  go to Site Database → Site Management → Site Settings → Certificates.Double click on the PXE certificate and make sure that there is an entry that is NOT listed as blocked
6. from here you should be able to boot into the boot media without issue. however, if the certificate has expired you will need to re build your boot media.

This article can also be found on our sister site DizzyIT.com : http://dizzyit.com/2011/11/16/sccm-pxe-error-booting-certificate-media-expired/