Sharing the knowledge is a gift to improve awareness... Making someone grow with you or above you is precious...
Search This Blog
Saturday, December 31, 2011
Sunday, December 25, 2011
Using Batch Files to Automate Networking Tasks - PART3
How to Restart Services On All Domain Controllers Within a Domain
To restart service on all domain controllers within a domain, perform the following steps:- Create the Restart.bat and Restart2.bat files listed below.
- Run the Restart.bat Service Name from a computer running Windows NT using administrator privileges. The Restart.bat file issues the Windows NT Resource Kit utility NETDOM to create a file called Netdom.txt. The Netdom.txt file gets parsed using the FOR command (part of Windows NT command extensions). Each \\DomainControllerName gets passed to the Restart2.bat file where the Windows NT Resource Kit utility NETSVC command gets issued to stop and start the Service Name entered at the command prompt.
echo off
cls
if (%1)==() goto NoParams
netdom bdc > netdom.txt
for /F "skip=6 tokens=4" %%a in (netdom.txt) do call restart2.bat
%%a %1
echo ---------
echo - Done! -
echo ---------
goto bottom
:NoParams
echo usage: RESTART "Service Name"
echo.
echo. i.e.- RESTART "License Logging Service"
echo.
:bottom
Filename: RESTART2.BAT
echo Restarting %2 on %1
netsvc %2 %1 /stop
netsvc %2 %1 /start
echo.
Using Batch Files to Automate Networking Tasks - PART2
How to Add Files to Many Users' Home Directories
To add files to many users' home directories, perform the following steps:- Create the Addfile.bat and Addfile2.bat files listed below.
- Run Addfile.bat <Parent Directory> <File to Add> with administrative privileges from a computer running Windows NT. The Addfile.bat file simply issues a DIR command and redirects the output to a file, which in turn gets parsed using the FOR command (part of Windows NT command extensions). The Addfile2.bat file gets called once for each directory name listed in the Dir.txt file. The Addfile2.bat file issues a copy command to copy the file to each user directories.
v
echo off
cls
IF (%1)==() GOTO NoParams
IF (%2)==() GOTO NoParams
Echo Creating directory listing...
dir %1 > dir.txt
for /F "skip=7 tokens=4" %%a in (dir.txt) do call addfile2.bat %%a
%1 %2
echo ---------
echo - Done! -
echo ---------
GOTO Bottom
:NoParams
ECHO usage: ADDFILE [Parent Directory] [File to Add]
ECHO.
ECHO i.e.- ADDFILE C:\PROFILES MyFile.lnk
ECHO.
:Bottom
Filename: ADDFILE2.BAT
if (%1)==() goto bottom
if (%1)==(bytes) goto bottom
copy %3 %2\%1
:bottom
Using Batch Files to Automate Networking Tasks - PART1
The following tasks will be illustrated:
- How to automate the addition of Domain\Domain Users global group to each of the member servers Change the system time user right.
- How to add files to many users' home directories.
- How to restart services on all domain controllers within a domain.
How to Automate the Addition of Domain\Domain Users
How to automate the addition of "Domain\Domain Users" global group to each of the member servers "Change the system time" user right.- Create the Addtime.bat and Addtime2.BAT files listed below.
- Run Addtime.bat with administrator privileges from a computer running Windows NT. This batch file creates a list of member servers using the Windows NT Resource Kit utility Netdom.exe. The output of NETDOM gets redirected to a file, which in turn, gets parsed using the FOR command (part of Windows NT command extensions). The Addtime2.bat file gets called for each instance of \\ServerName within the Netdom.txt file. The Addtime2.bat file then issues the Windows NT Resource Kit utility Ntrights.exe to add Domain\Domain Users global group to each of the member servers Change the system time user right. The output of NTRIGHTS gets written to a file called Log.txt.
echo off
cls
echo Creating a list of member servers.
echo.
netdom member > netdom.txt
echo Adding "Change System Time" right to Member Servers...
echo.
if exist log.txt del log.txt
for /F "skip=6 tokens=4" %%a in (netdom.txt) do
call ADDTIME2.bat %%a
echo.
echo ----------------------------------------------
echo - Done! Check LOG.TXT for status information.-
echo ----------------------------------------------
Filename: ADDTIME2.BAT
echo Adding right to %1...
ntrights -u "domain users" -m %1 +r SeSystemTimePrivilege >> log.txt
Friday, December 23, 2011
How To Add Users To Your Samba Domain - PART13
Adding The Users In Linux
Create the user
[root@bigboy tmp]# useradd -g 100 peter
Give them a Linux Password
[root@bigboy tmp]# passwd peter Changing password for user peter. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@bigboy tmp]#
Mapping The Linux Users To An smbpassword
[root@bigboy tmp]# /usr/bin/smbpasswd -a username password
Mapping A Private Windows Drive Share
Mapping Using "My Computer"
- Let the user log into the domain.
- Right-click on the "My Computer" icon on the desktop.
- Click on "Map Network Drive".
- Select a drive letter.
- Browse to the HOMENET domain, then the Samba server, then the user's home directory.
- Click on the check box "Reconnect at Logon", to make the change permanent
Mapping from the Command Line
[root@bigboy tmp]# vi /home/samba/netlogon/login.bat
REM Drive Mapping Script net use P: \\bigboy\
[root@bigboy tmp]# chmod 644 /home/samba/netlogon/login.bat
[root@bigboy tmp]# unix2dos /home/samba/netlogon/login.bat unix2dos: converting file /home/samba/netlogon/login.bat to DOS format ... [root@bigboy tmp]#
[global] logon script = login.bat
Setup Microsoft Windows 2008 R2 Failover Cluster in VMware Workstation - PART1
( in this example,
Qurom disk – 512MB,
Storage disk1- 2GB,
Storage disk 2- 2GB,
Storage disk 3 – 2GB,
and Backup disk 4GB)
Wednesday, December 21, 2011
Make Your PC Clients Aware Of Your Samba PDC (SAMBA) - PART12
Windows 95/98/ME and Windows XP Home
- Navigate to the Network section of the Control Panel (Start ->Settings->Control Panel->Network)
- Select the Configuration tab
- Highlight "Client for Microsoft Networks"
- Click the Properties button.
- Check "Log onto Windows NT Domain", and enter the domain name.
- Click all the OK buttons and reboot!
Windows NT
- Navigate to the Network section of the Control Panel (Start ->Settings->Control Panel->Network )
- Select the "Identification" tab
- Click the "Change" button
- Enter the domain name and computer name, do not check the box Create a Computer Account in the Domain. In this case, the existing machine trust account is used to join the machine to the domain.
- Click "OK". You should get "Welcome to <DOMAIN>" message as confirmation that you've been added.
- Reboot.
Windows 200x and Windows XP Professional
- Press the Windows and Break keys simultaneously to access the System Properties dialogue box.
- Click on the 'Network Identification' or 'Computer Name' tab on the top.
- Click the "Properties" button.
- Click on the "Member of Domain" button.
- Also enter your domain name and computer name and then click "OK"
- You will be prompted for a user account and password with rights to join a machine to the domain. Enter the information for your Samba administrator. In this home environment scenario, the user would be root with the corresponding smbpasswd password. Now, you should get a "Welcome to <DOMAIN>" message confirming that you've been added.
- Reboot.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters] "requiresignorseal"=dword:00000000 "signsecurechannel"=dword:00000000
Friday, December 16, 2011
Is That Grinding Sound the Death of My Hard Drive?
By Lincoln Spector, PCWorld Nov 17, 2011 7:44 AM
Ericuse165 has a friend with a PC that's making a grinding noise. Eric asked the Hard Drives, NAS Drives, Storage forum for advice.
First, backup that hard drive. And I mean now! That drive could die any minute, and when it does, it will cost hundreds or even thousands of dollars to retrieve your files--if the files can be retrieved.
Do a full image backup of the entire drive, including all partitions. EASEUS Todo Backup andMacrium Reflect Free are both free and either one will do the job just fine. You'll need an external hard drive to back the images onto.
Both programs also have an option for creating a bootable CD from which you can restore the backup. Create that CD.
Backed up? Good. Now you need to determine if it’s the hard drive making the noise, or just a fan.
If the PC is a desktop, open it up, turn it on, and try to locate the location of the noise. If you can't, find yourself a hollow tube--the cardboard one from a used-up paper towel roll works. Holding one end of tube to your ear, point the other end to various locations in the PC, especially towards the hard drive and fans. You'll easily pinpoint the source of the grinding.
Laptops aren't that easy. If you feel comfortable opening yours, use the desktop instructions above. Otherwise, try to determine the location of the fan and the hard drive from the outside. The fan is probably near a vent. Most laptops are designed to make hard drives easy to remove and replace. If you can't find where the drive is located, check your model's online manual.
Once you know where everything is, use the cardboard tube method described above.
If the noise is coming from a fan, and the PC is open, look for something obstructing the fan. Remove it if you find it. If the fan is loose; tighten it. Otherwise, replace it.
But if a fan is making the noise, and you're not comfortable opening the laptop, bring it to a professional and explain the problem.
And if it really is the hard drive making the noise? Buy a new hard drive, install it, and restore Windows and your files from that image backup.
Read the original forum discussion.
Contributing Editor Lincoln Spector writes about technology and cinema. Email your tech questions to him at answer@pcworld.com, or post them to a community of helpful folks on the PCW Answer Line forum. Follow Lincoln on Twitter, or subscribe to the Answer Line newsletter, e-mailed weekly.
- See more like this:
- hard drives,
- internal hard drive,
- repair
PC Dies Before It Can Begin to Boot
When Kennyrosenyc turns on his PC, it dies before it even begins to boot. He asked the Windows forum for help.
You can't blame this one on Windows. If the PC shuts down before it tries to boot off the hard drive (or off of a CD or flash drive), then you definitely have a hardware problem. And the piece of hardware that's giving you the problem is almost certainly not the hard drive.
You're going to have to decide between fixing or replacing the computer. But before you do that, you must rescue your files--especially if you don't have a recent backup.
Since you can't boot off a CD or flash drive, and therefore can't use a live Linux variant, you'll have to remove the hard drive from the old computer and attach it to another computer as a second drive. I can't tell you how to remove the hard drive for your particular model, but you can probably find instructions online. It isn't difficult.
If the working PC is a desktop, you can open it up and install the broken PC's drive as a second, non-booting drive. Or you can borrow or buy an SATA/USB or IDE/USB adapter that will turn the old drive temporarily into an external one. These adapters sell for anything from $15 to $30, and are your only real option if that working computer is a laptop, or if you borrowed the working PC and the owner doesn't want you opening it.
Once a working computer can access the drive, you can copy your files to another location.
Now that you've saved your files, let's get back to the original question: Repair or replace?
If the fan won't start or dies soon after it does, the problem is likely your power supply. If you have a desktop PC, power supplies are cheap (some less than $30) and easy to replace. It might be worth a gamble to see if that's your problem before you try anything else.
Otherwise, unless you're particularly skilled at working with computer hardware, I'd recommend taking it to a professional. On the other hand, if the PC getting old, replacing it may make more sense.
Thursday, December 15, 2011
How To Add Workstations To Your Samba Domain (SAMBA) - PART11
Create Samba Trust Accounts For Each Workstation
Manual Creation Of Machine Trust Accounts (NT Only)
[root@bigboy tmp]# groupadd samba-clients [root@bigboy tmp]# /usr/sbin/useradd -g samba-clients \ -d /dev/null -s /bin/false machine_name$ [root@bigboy tmp]# passwd -l machine_name$ [root@bigboy tmp]# smbpasswd -a -m machine_name
Dynamic Creation of Machine Trust Accounts
[global] # <...remainder of parameters...> add machine script = /usr/sbin/useradd -d /dev/null -g samba-clients -s /bin/false -M %u
[root@bigboy tmp]# groupadd samba-clients
[root@bigboy tmp]# smbpasswd -a -m machine_name
Tuesday, December 13, 2011
OPA-Backup is able to backup the product activation of Microsoft Office
To use OPA-Backup, please follow the rules listed below:
- You must have bought Microsoft Office.
- Microsoft Office has to be activated.
- You must fulfill the software license agreement of Microsoft Office.
- OPA-Backup is not directed against Microsoft.
- OPA-Backup is no illegal crack.
Sunday, December 11, 2011
How To Create A Samba PDC Administrator User (SAMBA) - Part10
Home Environment
[root@bigboy tmp]# /usr/bin/smbpasswd -a root password
Corporate Environment
domain admin group = @sysadmin admin users = @sysadmin printer admin = @sysadmin
Samba Passwords (SAMBA) - PART9
The [printers] Share Section (SAMBA) - PART8
[printers] comment = All Printers path = /var/spool/samba printable = Yes browseable = No
Wednesday, December 7, 2011
The [netlogon] and [profiles] Share Sections (SAMBA, SWAT) - PART7
[netlogon] path = /home/samba/netlogon guest ok = Yes [profiles] path = /home/samba/profiles read only = No create mask = 0600 directory mask = 0700
- Click the Shares button.
- Create a [netlogon] share.
- Modify the path and guest ok settings.
- Click on the Commit Changes button.
- Create a [profiles] share section.
- Modify the path, mask and read only settings. The mask settings allow only the owner of the netlogon subdirectory to be able to modify its contents.
- Click on the Commit Changes button.
[root@bigboy tmp]# mkdir -p /home/samba/netlogon [root@bigboy tmp]# mkdir -p /home/samba/profile [root@bigboy tmp]# chmod -R 0755 /home/samba