Jump to content
Sign in to follow this  
rudi

Set primary DNS Suffix for all IP enabled NICs

Recommended Posts

rudi

Hi.

PsaltyDS posted a very nice code to READ what I want to set, it's here

I'm not sure if it is possible using NETSH, who knows?

At this Technet document there is a VB example. Well, all this WMI stuff is quite Greek to me...

Any suggestions appreciated, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
Airwolf

Here is a translation of that example to AutoIt:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

$Computer = "."
$WMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $Computer & "\root\cimv2")
$NetCards = $WMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For $NetCard in $NetCards
    $NetCard.SetDNSDomain("fabrikam.com")
Next

Func MyErrFunc()
 ;Resume
EndFunc

Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites
rudi

Here is a translation of that example to AutoIt.

Thanks a lot :mellow: to you!

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×