× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rob,

When you "role swap" from primary to back or visa/versa, do you have to run scripts similar to these?

Paul

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Rob Berendt
Sent: Wednesday, May 02, 2018 2:20 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Initiating a Windows DNS change from IBM i

With all this talk of HA solutions I thought I'd share our solution for
initiating a Windows DNS change from IBM i.

Quick-EDD uses "switch scenarios". These are scripts. Comparable to BRMS
control groups. However do not think this is a function of Quick-EDD as I
used this same technique with Mimix when we ran that.

Way down in the one script I have
Seq. Command to execute
610 ADDLIBLE LIB(ROUTINES) POSITION(*LAST)
620 SETDNS SERVER(GDISYS) FROMIP('10.10.6.129') TOIP('10.27.6.129')
...
ROUTINES is our utility library.

If you prompt our SETDNS you will see
Server . . . . . . . . . . . . . SERVER
From IP . . . . . . . . . . . . FROMIP
To IP . . . . . . . . . . . . . TOIP
User Id . . . . . . . . . . . . RMTUSER 'qsecofr'
Password . . . . . . . . . . . . RMTPWD <redacted>
We often use CHGCMDDFT on it to keep the password updated. Yes QSECOFR
also exists in Windows, with a matching password.

SETDNS is a RPGLE program.

SETDNS talks to an intermediary PC. Something about our security does not
allow IBM i remote commands to work on our servers but IBM i security will
work on Windows clients who can then talk to Windows servers.
// Check intermediary with a ping
if $chkIntermediary();

// Check that Intermediary is accepting remote commands
if $chkRMTcmd();

// Delete 'from' DNS entry
//callp $delIP(domain1:inSvr:inIP1);
callp $delIP(domain2:inSvr:inIP1);

// If called without second parm, the program is in delete
// mode where a test entry has been used, and now needs
// to be deleted.
if %addr(inIP2)<>*null;
// Add the 'to' DNS entry
//callp $addIP(domain1:inSvr:inIP2);
callp $addIP(domain2:inSvr:inIP2);
endif;
endif;
endif;


Here's a snippet from $addIP
callp $CvtDomain(Domain:Svr:inDomain:InSvr);

cmd='RUNRMTCMD CMD('''
+ 'C:\PSTools\psexec \\' + DNSsvr
+ ' -u ' + UsrDomain + '\' + %trim(InUserId)
+ ' -p ' + %trim(InPassword)
+ ' -h c:\Windows\System32\DNSCMD.EXE ""'+ DNSsvr
+ ' /recordadd ' + Domain + ' ' + Svr
+ ' 600 A ' + IP + '""'')'
+ ' RMTLOCNAME(''' + Intermediary +''' *IP)'
+ ' RMTUSER(' + %trim(InUserId) +') RMTPWD('
+ %trim(InPassword) + ')';

callp QCMDEXC(cmd:%len(cmd));

The big clues from this snippet are:
look for pstools and psexec on the internet
Also notice the dnscmd.exe

I have a licensing issue with my Rational going on right now and the
coworker I want to help me with it is on a day off so I may post to
code.midrange.com later.


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.