Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Set Domain Name.

HTVi
TV Discussion Newsgroups

Set Domain Name.
"Andrew Staley" <NOREPLY[ at ]NOREPLY.COM> 6/13/2007 9:23:50 AM
Currently I am working on a script to setup new PC's for our network. So
far I have a working script that sets up the network addresses, what I need
though is a way to set the Domain Name.

I have looked around on the net and cant find an answer to what I'm looking
for, so hopefully someone here can help.

So far my script is fairly basic, essentially just running a bat file (not
being a script writer and only just starting out in IT I've had to work this
out from scratch and make things as simple as possible).

----------------------------------------------------------------------------------------

[ at ]echo off
netsh interface ip set address local static 192.168.1.87 255.255.255.0
192.168.1.240 1
netsh interface ip set dns "Local Area Connection" static 192.168.1.100
primary
netsh interface ip add dns name="Local Area Connection" addr=192.168.1.200
index=2
exit

----------------------------------------------------------------------------------------

This will get the PC on the network simply enough, and all I need to do is
change the IP address as needed. What I need though is a way to set the
domain name to "DOMAIN_SERVER" and allow it to connect, any help is greatly
appreciated.

Andrew.


RE: Set Domain Name.
Dan 6/15/2007 7:06:01 PM
So are you looking for a way to add the machine to the domain or a way to set
the domain suffix search order?

"Andrew Staley" wrote:

[Quoted Text]
> Currently I am working on a script to setup new PC's for our network. So
> far I have a working script that sets up the network addresses, what I need
> though is a way to set the Domain Name.
>
> I have looked around on the net and cant find an answer to what I'm looking
> for, so hopefully someone here can help.
>
> So far my script is fairly basic, essentially just running a bat file (not
> being a script writer and only just starting out in IT I've had to work this
> out from scratch and make things as simple as possible).
>
> ----------------------------------------------------------------------------------------
>
> [ at ]echo off
> netsh interface ip set address local static 192.168.1.87 255.255.255.0
> 192.168.1.240 1
> netsh interface ip set dns "Local Area Connection" static 192.168.1.100
> primary
> netsh interface ip add dns name="Local Area Connection" addr=192.168.1.200
> index=2
> exit
>
> ----------------------------------------------------------------------------------------
>
> This will get the PC on the network simply enough, and all I need to do is
> change the IP address as needed. What I need though is a way to set the
> domain name to "DOMAIN_SERVER" and allow it to connect, any help is greatly
> appreciated.
>
> Andrew.
>
>
>
Re: Set Domain Name.
"Andrew Staley" <andrew[ at ]staleyBLOCK.eclipse.co.uk> 6/16/2007 11:18:06 AM
I'm looking for a way to add the machine to the domain. I've tried the
script on the MS site and cant seem to get it to work.

Andrew.

"Dan" <Dan[ at ]discussions.microsoft.com> wrote in message
news:54B30EE5-0D45-438C-843F-4F1D52A69855[ at ]microsoft.com...
[Quoted Text]
> So are you looking for a way to add the machine to the domain or a way to
> set
> the domain suffix search order?
>
> "Andrew Staley" wrote:
>
>> Currently I am working on a script to setup new PC's for our network. So
>> far I have a working script that sets up the network addresses, what I
>> need
>> though is a way to set the Domain Name.
>>
>> I have looked around on the net and cant find an answer to what I'm
>> looking
>> for, so hopefully someone here can help.
>>
>> So far my script is fairly basic, essentially just running a bat file
>> (not
>> being a script writer and only just starting out in IT I've had to work
>> this
>> out from scratch and make things as simple as possible).
>>
>> ----------------------------------------------------------------------------------------
>>
>> [ at ]echo off
>> netsh interface ip set address local static 192.168.1.87 255.255.255.0
>> 192.168.1.240 1
>> netsh interface ip set dns "Local Area Connection" static 192.168.1.100
>> primary
>> netsh interface ip add dns name="Local Area Connection"
>> addr=192.168.1.200
>> index=2
>> exit
>>
>> ----------------------------------------------------------------------------------------
>>
>> This will get the PC on the network simply enough, and all I need to do
>> is
>> change the IP address as needed. What I need though is a way to set the
>> domain name to "DOMAIN_SERVER" and allow it to connect, any help is
>> greatly
>> appreciated.
>>
>> Andrew.
>>
>>
>>


Re: Set Domain Name.
Dan 6/16/2007 7:41:00 PM
Since you are already using a .bat script, you can use the netdom command to
add your machine to the domain. The only gotcha is that you have to provide
a username and password for both the machine that you want to add to the
domain as well as for a user that has rights to add to the domain. Not
usually secure to have that stuff in scripts, but if you're the only one
running it....

Here's the reference...

NETDOM JOIN machine /Domain:domain [/OU:ou path] [/UserD:user]

[/PasswordD:[password | *]]

[UserO:user] [/PasswordO:[password | *]]

[/REBoot[:Time in seconds]]



NETDOM JOIN Joins a workstation or member server to the domain.

machine is the name of the workstation or member server to be joined



/Domain Specifies the domain which the machine should join

/UserD User account used to make the connection with the domain

specified by the /Domain argument

/PasswordD Password of the user account specified by /UserD. A * means

to prompt for the password

/UserO User account used to make the connection with the machine to

be joined

/PasswordO Password of the user account specified by /UserO. A * means

to prompt for the password

/OU Organizational unit under which to create the machine account.

This must be a fully qualified RFC 1779 DN for the OU.

If not specified, the account will be created under the
default

organization unit for machine objects for that domain.

/REBoot Specifies that the machine should be shutdown and
automatically

rebooted after the Join has completed. The number of seconds

before automatic shutdown can also be provided. Default is

20 seconds



"Andrew Staley" wrote:

[Quoted Text]
> I'm looking for a way to add the machine to the domain. I've tried the
> script on the MS site and cant seem to get it to work.
>
> Andrew.
>
> "Dan" <Dan[ at ]discussions.microsoft.com> wrote in message
> news:54B30EE5-0D45-438C-843F-4F1D52A69855[ at ]microsoft.com...
> > So are you looking for a way to add the machine to the domain or a way to
> > set
> > the domain suffix search order?
> >
> > "Andrew Staley" wrote:
> >
> >> Currently I am working on a script to setup new PC's for our network. So
> >> far I have a working script that sets up the network addresses, what I
> >> need
> >> though is a way to set the Domain Name.
> >>
> >> I have looked around on the net and cant find an answer to what I'm
> >> looking
> >> for, so hopefully someone here can help.
> >>
> >> So far my script is fairly basic, essentially just running a bat file
> >> (not
> >> being a script writer and only just starting out in IT I've had to work
> >> this
> >> out from scratch and make things as simple as possible).
> >>
> >> ----------------------------------------------------------------------------------------
> >>
> >> [ at ]echo off
> >> netsh interface ip set address local static 192.168.1.87 255.255.255.0
> >> 192.168.1.240 1
> >> netsh interface ip set dns "Local Area Connection" static 192.168.1.100
> >> primary
> >> netsh interface ip add dns name="Local Area Connection"
> >> addr=192.168.1.200
> >> index=2
> >> exit
> >>
> >> ----------------------------------------------------------------------------------------
> >>
> >> This will get the PC on the network simply enough, and all I need to do
> >> is
> >> change the IP address as needed. What I need though is a way to set the
> >> domain name to "DOMAIN_SERVER" and allow it to connect, any help is
> >> greatly
> >> appreciated.
> >>
> >> Andrew.
> >>
> >>
> >>
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen