Re: netsh problem



Hi,
First get connected to the remote machine using the following command:
netsh -r <remote_machine_name/IP> -u <Administrator_on_remote_machine> -p
<passwd_of _remote_admin>
This will get you to the netsh context on the remote server. After this
execute the command you want

If you want to do it within your automation and execute it on the remote
machine at one shot make the following script(say netsh_dns.txt)

push interface ip
set dns "Local Area Connection" static 10.0.0.1 primary
popd

and execute the following command
netsh -r <remote_machine_name/IP> -u <Administrator_on_remote_machine> -p
<passwd_of _remote_admin> -f netsh_dns.txt

Let me know if you have any more doubts.
--
Thanks,
Janani.
--
"This posting is provided "AS IS" with no warranties, and confers no
rights."
"Morten" <morten_skovgaard@xxxxxxxxxxx> wrote in message
news:e0fqZyWSFHA.3076@xxxxxxxxxxxxxxxxxxxxxxx
>I was hoping to be able to rely on standard MS tools...
>
> Best regards
>
> Morten
>
> "Arek Iskra [MVP]" <NoSpam_arek@xxxxxxxxxxxxx> wrote in message
> news:OmMZ3kzRFHA.1476@xxxxxxxxxxxxxxxxxxxxxxx
>> "Morten" <morten_skovgaard@xxxxxxxxxxx> wrote in message
>> news:u0U8nFyRFHA.3988@xxxxxxxxxxxxxxxxxxxxxxx
>>> Hi!
>>>
>>> I'm trying to change the primary DNS server on some of our servers
>>> remotely using netsh.
>>>
>>> I'm able to change the address just fine on a local server if I use:
>>>
>>> netsh interface ip set dns "Local Area Connection" static 10.0.0.1
>>> primary
>>>
>>> However if I try:
>>>
>>> netsh
>>> set machine remoteserver
>>> interface ip set dns "Local Area Connection" static 10.0.0.1 primary
>>>
>>> it tells me that the command is not available. If I try:
>>>
>>> netsh
>>> set machine remoteserver
>>> interface ip
>>>
>>> and type "set"
>>>
>>> it gives me these choices:
>>>
>>> set file - Copy the console output to a file.
>>> set machine - Sets the current machine on which to operate.
>>> set mode - Sets the current mode to online or offline.
>>>
>>> These however are apparently not available:
>>>
>>> set address - Sets the IP address or default gateway to the specified
>>> interface.
>>> set dns - Sets DNS server mode and addresses.
>>> set wins - Sets WINS server mode and addresses.
>>>
>>> (But they are available when I use them directly on the remote server
>>> via RDP).
>>>
>>> I've opened the command prompt on the server that I'm executing the
>>> commands from as a user who's a member of the administrator group on
>>> both the local and the remote server. I assume that that gives me
>>> sufficient permissions - or? The servers are NOT part of a domain and
>>> they're both Windows Server 2003 Standard Edition.
>>>
>>> Thanks in advance for your help.
>>>
>>> Morten
>>>
>>>
>>
>> Try executing it with psexec from Sysinternals and see how it goes.
>>
>> --
>> Arek Iskra
>> MVP for Windows Server - Software Distribution
>>
>>
>
>


.



Relevant Pages

  • [UNIX] GNU Mailutils Multiple Vulnerabilities (Buffer Overflows, Format String, DoS)
    ... execute arbitrary code from remote using the GNU Mailutils programs. ... Remote exploitation of a format string vulnerability in the imap4d server ... The vulnerability specifically exists in the handling of the command tag ...
    (Securiteam)
  • Re: IIS 6.0 on Windows Server 2003
    ... If PHP insists on using CMD.EXE to execute the shellcommand on the ... server, then no, you have no choice -- you must give read permissions to the ... this would be a security vulnerability caused by PHP. ...
    (microsoft.public.inetserver.misc)
  • Re: error messages in mce 2005, why?
    ... The remote is considered optional, since you can order an MCE PC without a tuner. ... Most vendors like Sony, Dell, Compaq consider the remote an option. ... Execute the command regsvr32.exe atl.dll ...
    (microsoft.public.windows.mediacenter)
  • Re: Error running sql command
    ... If the commands are in a table on the server, I would create strings on the server and use SQL EXECUTE to execute them... ... I fetch a command from a table, process it and if command executes successfully I delete it form the queue. ... The basic problem with your code is that you are not using SQL Server as it should be used. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: [opensuse] mailing from CLI
    ... I have a remote mail ... server which works perfectly fine with thunderbird. ... the command line Tools all depend on Postfix/Sendmail to ... The remote server I'm using listens on port 993, ...
    (SuSE)