Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Scripted Steps

Info

Copy & paste into Background Scripts in each instance.

Code Block

This is now a scheduled job in System Definition > Scheduled Jobs. Move this into VCS when you get a chance (smile)

In github now https://git.yale.edu/df336/ServiceNow

Code Block
//
// bw - 20120416 - adapted from http://wiki.service-now.com/index.php?title=Post-Cloning_Checklist
 
//
// keep pseudo-globals in object namespace to avoid name collisions
var common = {};
var dev    = {};
var tst    = {};
var trn    = {};
var pre    = {};
var prd    = {};
 
//
// use to hash datasource names + urls
dev.dataSources = new Array();
tst.dataSources = new Array();
trn.dataSources = new Array();
pre.dataSources = new Array();
prd.dataSources = new Array();
 
//
// other canon (common to all but desirable here anyway)
common.SMTPServer = "smtp.gmail.com";
common.SMTPPort   = 587;
common.SMTPTLS    = true;
common.SMTPAuth   = true;
common.POP3Server = "pop.gmail.com";
common.POP3Secure = true;
 
//
// get this instance's name
common.instance = gs.getProperty("instance_name");
 
//
// here's where you should set all instance-specific values
dev.longName                      = "yaledevelopment";
dev.shortName                     = "dev";
dev.adminsname                          = ["ww26-admin","ekt6-admin","bm364-admin","gilbert-admin","drm43-admin"];
dev.SMTPUser"IT Service Management Suite (DEVELOPMENT)";
dev.color                          = "servicenow-dev@yale.edurgb(255, 0, 0)";
dev.POP3Useradmins                        = ["servicenow-dev@yale.edu";
dev.SMTPActiveekt6-admin","allen.doering","ss2326-admin","mp576-admin","al28-admin","ml34-admin","hp269-admin","james.woodford","michael.hale","df336-admin"];
dev.actors                        = true[];
dev.testRcptSMTPUser                      = "dh4234@gmailservicenow-dev@yale.comedu";
dev.dataSources["IST-User"]POP3User       = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist3,cn=oracleContext,dc=world"; dev.dataSources["DW - Manager"]   = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh7,cn=oracleContext,dc=world";
dev.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh7,cn=oracleContext,dc=world";

tst.longName        = "servicenow-dev@yale.edu";
dev.SMTPActive                      = "yaletest"true;
tstdev.shortNametestRcpt                      = "tstdh4234@gmail.com";
tst.admins                 dev.dataSources["IST-User"]       = ["ww26-admin","vb248-admin"];
tst.SMTPUser           "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist3,cn=oracleContext,dc=world";
dev.dataSources["DW - Manager"]   = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh7,cn=oracleContext,dc=world";
dev.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh7,cn=oracleContext,dc=world";
 
tst.longName           = "servicenow-tst@yale.edu";
tst.POP3User          = "yaletest";
tst.shortName                      = "servicenow-tst@yale.edutst";
tst.SMTPActivename                          = true "IT Service Management Suite (TEST)";
tst.testRcptcolor                         = "its50test@mailman.yale.edurgb(255, 165, 0)";
tst.dataSources["IST-User"]admins            = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist2,cn=oracleContext,dc=world";
tst.dataSources["DW - Manager"]   = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh4,cn=oracleContext,dc=world";
tst.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh4,cn=oracleContext,dc=world";

trn.longName            = ["ekt6-admin","ss2326-admin","allen.doering","james.woodford","michael.hale","hp269-admin","ml34-admin","al28-admin","df336-admin"];
tst.actors                        = "yaletraining"["mp576-actor","rico-actor"];
trntst.shortNameSMTPUser                      = "trnservicenow-tst@yale.edu";
trntst.adminsPOP3User                        = ["ww26-admin","mo4-admin","kb32-admin"];
trn.SMTPUser  servicenow-tst@yale.edu";
tst.SMTPActive                    = "servicenow-trn@yale.edu"true;
trntst.POP3UsertestRcpt                      = "servicenow-trn@yaleits50test@gmail.educom";
trn.SMTPActive             tst.dataSources["IST-User"]       = false;
trn.testRcpt                      = "its50test@mailman.yale.edu";
trn.dataSources["IST-User"]       = "jdbc:oracle:"jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist1ist2,cn=oracleContext,dc=world";
trntst.dataSources["DW - Manager"]   = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1dwh4,cn=oracleContext,dc=world";
trntst.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1dwh4,cn=oracleContext,dc=world";
 
pretrn.longName                      = "yalepreproductionyaletraining";
pretrn.shortName                     = "pretrn";
pretrn.adminsname                          = ["ww26-admin"];
pre.SMTPUser"IT Service Management Suite (TRAINING)";
trn.color                         = "servicenow-pre@yale.edurgb(0, 127, 0)";
pretrn.POP3Useradmins                        = "servicenow-pre@yale.edu";
pre.SMTPActive["kb32-admin","ekt6-admin","dmo6-admin","mk2-admin","ss2326-admin","df336-admin"];
trn.actors                    = true; pre.testRcpt  = ["ml34-actor","al28-actor","mp576-actor","rico-actor"];
trn.SMTPUser                      = "its50test@mailmanservicenow-trn@yale.yale.edu";
pre.dataSources["IST-User"]trn.POP3User                      = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist1,cn=oracleContext,dc=world";
pre.dataSources["DW - Manager"]   servicenow-trn@yale.edu";
trn.SMTPActive                    = false;
trn.testRcpt                      = "its50test@mailman.yale.edu";
trn.dataSources["IST-User"]       = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1ist1,cn=oracleContext,dc=world";
pretrn.dataSources["DWH-DIVDEPTORGDW - Manager"]   = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1,cn=oracleContext,dc=world";
trn.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1,cn=oracleContext,dc=world";
 prd
pre.longName                      = "yaleyalepreproduction";
prdpre.shortName                     = "prdpre";
prdpre.adminsname                          = ["ww26-admin"];
prd.SMTPUser"IT Service Management Suite (PRE-PRODUCTION)";
pre.color                         = "servicenow@yale.edurgb(15, 77, 146)";
prdpre.POP3Useradmins                        = "servicenow@yale.edu";
prd.SMTPActive["hp269-admin","s_metricus","michael.hale","ss2326-admin","df336-admin"];
pre.actors                        = true;
prd.testRcpt["ml34-actor","al28-actor","mp576-actor","rico-actor"];
pre.SMTPUser                      = ""servicenow-pre@yale.edu";
prd.dataSources["IST-User"]pre.POP3User                      = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist1,cn=oracleContext,dc=worldservicenow-pre@yale.edu";
prd.dataSources["DW - Manager"]pre.SMTPActive                    = true;
pre.testRcpt                      = "its50test@gmail.com";
pre.dataSources["IST-User"]       = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1ist1,cn=oracleContext,dc=world";
prdpre.dataSources["DWHDW -DIVDEPTORG Manager"]   = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1,cn=oracleContext,dc=world";
pre.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://
// all non-prod is broken out in case the need arises to break formation
// with the defaultConfig().
switch (common.instance) {
	case prd.longName:oid.its.yale.edu:389/dwh1,cn=oracleContext,dc=world";
 
prd.longName                      = "yale";
prd.shortName                  // shouldn't be cloning prod post-go-live!
		gs.print("**** You're running this script in production, are you asking for trouble?");
		break;
	case dev.longName: 
		defaultConfig(dev);
		break;
	case tst.longName: 
		defaultConfig(tst);
		break;
	case trn.longName: 
		defaultConfig(trn);
		break;
	case pre.longName: 
		defaultConfig(pre);
		break;
	default:= "prd";
prd.name                          = "IT Service Management Suite";
prd.color                      // bail if this is an unknown instance
		gs.print("**** I don't understand what this instance is for: " + common.instance);
  //
} // end switch statement


function defaultConfig(specific) {= "rgb(15, 77, 146)";
prd.admins                        = ["ekt6-admin","ss2326-admin","df336-admin"];
prd.actors            //          // default way= to configure a non-prod environment[];
prd.SMTPUser             // setEnvironmentMarkers(specific.color,specific.name);        = setSAMLProperties(specific.longName)"servicenow@yale.edu";
prd.POP3User         setDataSourceURLs(specific.dataSources);             = enableAdminUsers(specific.admins)"servicenow@yale.edu";
prd.SMTPActive                    = true;
prd.testRcpt                      = "";
prd.dataSources["IST-User"]       = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/ist1,cn=oracleContext,dc=world";
prd.dataSources["DW - Manager"]          setPOP3Properties(specific.POP3User,
                          common.POP3Server, = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1,cn=oracleContext,dc=world";
prd.dataSources["DWH-DIVDEPTORG"] = "jdbc:oracle:thin:@ldap://oid.its.yale.edu:389/dwh1,cn=oracleContext,dc=world";
 
//
// all non-prod is broken out in case the need arises to break formation
// with the defaultConfig().
switch (common.instance) {
    case prd.longName: 
                // shouldn't be cloning prod post-go-live!
        gs.print("**** You're running this script in production, are you asking   common.POP3Securefor trouble?");
        break;
   setSMTPProperties(specific.SMTPUser  ,case dev.longName: 
        defaultConfig(dev);
        break;
    case  commontst.SMTPServerlongName: 
,        defaultConfig(tst);
        break;
    case trn.longName: 
  common.SMTPPort    ,  defaultConfig(trn);
        break;
    case pre.longName: 
        common.SMTPTLSdefaultConfig(pre);
    ,    break;
    default: 
                common.SMTPAuth// bail if this ,is an unknown instance
        gs.print("**** I don't understand what this instance is for: " +     specific.SMTPActive,common.instance);
  //
} // end switch statement
 
 
function defaultConfig(specific) {
        // 
 specific.testRcpt);       // default way to 
	gs.print("Applied Instance-Specific Configurations");configure a non-prod environment
 
  } // end defaultConfig()   function setSAMLProperties(instance) {setEnvironmentMarkers(specific.color,specific.name);
         //setSAMLProperties(specific.longName); 
        // set SAML properties so SSO logins are redirected to the right instancesetDataSourceURLs(specific.dataSources);  
        enableAdminUsers(specific.admins);
         gs.setProperty("glide.authenticate.sso.saml2.issuer","https://" + instance + ".service-now.com");enableActorUsers(specific.actors);
                        gs.setProperty("glide.authenticate.sso.saml2.service_url","https://" + instance + ".service-now.com/navpage.do");           } // end setSAMLProperties()   function setSMTPProperties(user, server, port,
tls, auth, active, testRcpt) {    setPOP3Properties(specific.POP3User,
    //         // set SMTP properties for a given instance... assume password the same across instancescommon.POP3Server,         gs.setProperty("glide.email.user",user);               gs.setProperty("glide.email.server",server);
        gs.setProperty("glide.smtp.port",port);         gs.setProperty("glide.smtp.tls",tls);         gs.setProperty("glide.smtp.auth",authcommon.POP3Secure);   
 
     gs.setProperty("glide.smtp.active",active);  // for now, maybe we'll only do this for test later on   setSMTPProperties(specific.SMTPUser  ,
                gs.setProperty("glide.email.test.user",testRcpt);   // } // end setSMTPProperties()   function setPOP3Properties(user, servercommon.SMTPServer  ,
secure) {         //         // set POP3 properties for a given instancecommon...SMTPPort assume password the same,
   across instances.         gs.setProperty("glide.pop3.server",server);         gs.setProperty("glide.pop3.secure",true);    common.SMTPTLS     gs.setProperty("glide.pop3.user",user);
  // } // end setPOP3Properties()   function setDataSourceURLs(dataSources) {         //      common.SMTPAuth   // align,
data source(s) with this name to specified url         for (var name in dataSources) {             var gr = new GlideRecord("sys_data_source");specific.SMTPActive,
             gr.addQuery("name","=",name);             gr.query();specific.testRcpt  ,
           while(gr.next()) {               "https://" + grspecific.connection_urllongName = dataSources[name]+ ".service-now.com/nav_to.do");   
 
        setCloningProperties(specific.longName);      
 
        setSomeCatalogActive ( grspecific.update(shortName );
        setOrgTestValues ( specific.shortName );
 }
    gs.print("Applied Instance-Specific Configurations"); 
}   //
} // end setDataSourceURLsdefaultConfig()
 
function enableAdminUserssetCloningProperties(adminsinstance) {
        //
         // typically for each user matching user_name in admins, remove lockout and activate usernon-prod instances, allow instance to be a clone targer
        gs.setProperty("glide.db.clone.allow_clone_target","true");
   for
(var} i// = 0; i < admins.length; i++end setCloningProperties()
 
function setSAMLProperties(instance) {
        //
     var gr = new GlideRecord("sys_user");
   // set SAML properties so SSO logins are redirected to the right instance
        grgs.addQuerysetProperty("user_nameglide.authenticate.sso.saml2.issuer","=",admins[i]);
            gr.query(https://" + instance + ".service-now.com");
             while(gr.next()) {
  gs.setProperty("glide.authenticate.sso.saml2.service_url","https://" + instance + ".service-now.com/navpage.do");
   
} // end setSAMLProperties()
 
 
 gr.active = true;
     function setSMTPProperties(user, server, port, tls, auth, active, testRcpt, overrideURL) {
        //
 gr.locked_out = false;     // set SMTP properties for a       gr.update();
     given instance... assume password the same across instances.
      }  gs.setProperty("glide.email.user",user);
      } }


function setEnvironmentMarkers(color,name) {
	// set the base color 
	 gs.setProperty("glide.email.server",server);
        gs.setProperty("cssglide.basesmtp.colorport",colorport);
  	//  set header name  	gs.setProperty("glide.productsmtp.descriptiontls",nametls);
    // } // end setEnvironmentMarkers()


Manual Steps

...

gs.setProperty("glide.smtp.auth",auth);
        gs.setProperty("glide.smtp.active",active);  
        gs.setProperty("glide.email.test.user",testRcpt);
        gs.setProperty("glide.email.override.url",overrideURL);
  //
} // end setSMTPProperties()
 
 
function setPOP3Properties(user, server, secure) {
        //
        // set POP3 properties for a given instance... assume password the same across instances.
        gs.setProperty("glide.pop3.server",server);
        gs.setProperty("glide.pop3.secure",true);
        gs.setProperty("glide.pop3.user",user);
  //
} // end setPOP3Properties()
 
 
function setDataSourceURLs(dataSources) {
        //
        // align data source(s) with this name to specified url
        for (var name in dataSources) {
            var gr = new GlideRecord("sys_data_source");
            gr.addQuery("name","=",name);
            gr.query(); 
            while(gr.next()) {
                gr.connection_url = dataSources[name];
                gr.update();
            }
        }
  //
} // end setDataSourceURLs()
 
 
function enableAdminUsers(admins) {
        // 
        // for each user matching user_name in admins, remove lockout and activate user
        for (var i = 0; i < admins.length; i++) {
            var gr = new GlideRecord("sys_user");
            gr.addQuery("user_name","=",admins[i]);
            gr.query(); 
            while(gr.next()) {
                gr.active = true;
                gr.locked_out = false;
                gr.update();
            }
        }
}
 
function enableActorUsers(actors) {
        // 
        // for each user matching user_name in actors, remove lockout and activate user
        for (var i = 0; i < actors.length; i++) {
            var gr = new GlideRecord("sys_user");
            gr.addQuery("user_name","=",actors[i]);
            gr.query(); 
            while(gr.next()) {
                gr.active = true;
                gr.locked_out = false;
                gr.update();
            }
        }
}
 
 
function setEnvironmentMarkers(color,name) {
    // set the base color 
    gs.setProperty("css.base.color",color);
  
    // set header name 
    gs.setProperty("glide.product.description",name);
  //
} // end setEnvironmentMarkers()
 
function setSomeCatalogActive ( shortName ){
   if ( shortName == 'trn' ||
        shortName == 'pre' ) {
        // dce9f6109df47c0094adfdb88ae63850 is Phones and Cable TV
        // 477f1d98a1bbc5c094ad46651315d89e is Pagers
        // 67af5d98a1bbc5c094ad46651315d822 is Telephone Services
        // d12fd958a1bbc5c094ad46651315d842 is Mobile Devices
        // d4e9f6109df47c0094adfdb88ae63856 is Wifi and Networks; now defaulting to active.
        // set categories active
        var gr1 = new GlideRecord('sc_category');
        var gr1OR = gr1.addQuery('sys_id','dce9f6109df47c0094adfdb88ae63850');
        gr1OR.addOrCondition('sys_id','477f1d98a1bbc5c094ad46651315d89e');
        gr1OR.addOrCondition('sys_id','67af5d98a1bbc5c094ad46651315d822');
        gr1OR.addOrCondition('sys_id','d12fd958a1bbc5c094ad46651315d842');
        gr1OR.addOrCondition('sys_id','d4e9f6109df47c0094adfdb88ae63856');
        gr1.query();
        while ( gr1.next() ) {
        //     gs.print('in loop, gr1.sys_id: ' + gr1.sys_id);
             gr1.active = 'true';
             gr1.update();
        }
        // ethernet add is 986e0ccc8795410094ad56926d434d0d
        var gr2 = new GlideRecord('sc_cat_item');
        gr2.addQuery('sys_id','986e0ccc8795410094ad56926d434d0d');
        gr2.query();
        while ( gr2.next() ) {
        //     gs.print('in loop, gr2.sys_id: ' + gr2.sys_id);
             gr2.active = 'true';
             gr2.update();
        }
   }
}
function setOrgTestValues ( shortName ){
   if ( shortName == 'tst' ||
        shortName == 'pre' ) {
        // In PRE-PROD and TEST, maybe in TRAINING,
        // we need to turn off the loader for ORG data,
        // then over ride the data in select ORGS with certain
        // cases to then walk through our large set of test cases.
        // DWH - Organization -> 2f32f71ea1fa858094ad46651315d80d
        var gr1 = new GlideRecord('scheduled_import_set');
        gr1.addQuery('sys_id','2f32f71ea1fa858094ad46651315d80d');
        gr1.query();
        if ( gr1.next() ) {
             //gs.print('the value of the import was: ' + gr1.active);
             gr1.active = 'false';
             gr1.update();
             //gs.print('the value of the import is now: ' + gr1.active);
        }
        // force values on ORGs
        // Nancy Scanlon -> 09bea76ad8d46c007ac0638b5167dcc6
        // Julie Grant -> df3c00b201d0ac0094adf4b82250a6d5
        // Holly Piscatelli -> fc6850360194ac0094adf4b82250a689
        // Jack Beecher -> c72a84be0190ac0094adf4b82250a6b4
        // Sue Castaldi -> a656147e0154ac0094adf4b82250a63c
        // Jim Slattery -> 446a14fa0194ac0094adf4b82250a648
        // Rose Rita Riccitelli -> 23bee3e6d8d46c007ac0638b5167dc59
        // 000803
        var org1 = new GlideRecord('u_cmn_organization');
        org1.addQuery('u_id','000803');
        org1.query();
        if ( org1.next() ) {
             //gs.print('ORG is: ' + org1.u_id);
             //gs.print('Ops: ' + org1.u_opsmgr);
             //gs.print('Lead: ' + org1.u_head);
             //gs.print('BOLT: ' + org1.u_bolt_member);
             org1.u_opsmgr = '09bea76ad8d46c007ac0638b5167dcc6';
             org1.u_head = 'fc6850360194ac0094adf4b82250a689';
             org1.u_bolt_member = 'df3c00b201d0ac0094adf4b82250a6d5';
             org1.update();
        }
        // 883001
        var org2 = new GlideRecord('u_cmn_organization');
        org2.addQuery('u_id','883001');
        org2.query();
        if ( org2.next() ) {
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
             org2.u_opsmgr = '';
             org2.u_head = 'a656147e0154ac0094adf4b82250a63c';
             org2.u_bolt_member = 'c72a84be0190ac0094adf4b82250a6b4';
             org2.update();
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
        }
        // 869001
        var org1 = new GlideRecord('u_cmn_organization');
        org1.addQuery('u_id','869001');
        org1.query();
        if ( org1.next() ) {
             //gs.print('ORG is: ' + org1.u_id);
             //gs.print('Ops: ' + org1.u_opsmgr);
             //gs.print('Lead: ' + org1.u_head);
             //gs.print('BOLT: ' + org1.u_bolt_member);
             org1.u_opsmgr = '23bee3e6d8d46c007ac0638b5167dc59';
             org1.u_head = '';
             org1.u_bolt_member = '446a14fa0194ac0094adf4b82250a648';
             org1.update();
        }
        // 016601
        var org2 = new GlideRecord('u_cmn_organization');
        org2.addQuery('u_id','016601');
        org2.query();
        if ( org2.next() ) {
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
             org2.u_opsmgr = '';
             org2.u_head = '';
             org2.u_bolt_member = 'df3c00b201d0ac0094adf4b82250a6d5';
             org2.update();
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
        }
        // 017901
        var org1 = new GlideRecord('u_cmn_organization');
        org1.addQuery('u_id','017901');
        org1.query();
        if ( org1.next() ) {
             //gs.print('ORG is: ' + org1.u_id);
             //gs.print('Ops: ' + org1.u_opsmgr);
             //gs.print('Lead: ' + org1.u_head);
             //gs.print('BOLT: ' + org1.u_bolt_member);
             org1.u_opsmgr = '09bea76ad8d46c007ac0638b5167dcc6';
             org1.u_head = 'fc6850360194ac0094adf4b82250a689';
             org1.u_bolt_member = '';
             org1.update();
        }
        // 018501
        var org2 = new GlideRecord('u_cmn_organization');
        org2.addQuery('u_id','018501');
        org2.query();
        if ( org2.next() ) {
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
             org2.u_opsmgr = '';
             org2.u_head = 'fc6850360194ac0094adf4b82250a689';
             org2.u_bolt_member = '';
             org2.update();
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
        }
        // 019501
        var org1 = new GlideRecord('u_cmn_organization');
        org1.addQuery('u_id','019501');
        org1.query();
        if ( org1.next() ) {
             //gs.print('ORG is: ' + org1.u_id);
             //gs.print('Ops: ' + org1.u_opsmgr);
             //gs.print('Lead: ' + org1.u_head);
             //gs.print('BOLT: ' + org1.u_bolt_member);
             org1.u_opsmgr = '09bea76ad8d46c007ac0638b5167dcc6';
             org1.u_head = '';
             org1.u_bolt_member = '';
             org1.update();
        }
        // 015701
        var org2 = new GlideRecord('u_cmn_organization');
        org2.addQuery('u_id','015701');
        org2.query();
        if ( org2.next() ) {
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
             org2.u_opsmgr = '';
             org2.u_head = '';
             org2.u_bolt_member = '';
             org2.update();
             //gs.print('ORG is: ' + org2.u_id);
             //gs.print('Ops: ' + org2.u_opsmgr);
             //gs.print('Lead: ' + org2.u_head);
             //gs.print('BOLT: ' + org2.u_bolt_member);
        }
   }
}

Manual Steps

  • add MID server accounts, re-register MID servers (to script) (all accounts on prod, persist through clone)
  • delete non-relevant (i.e. production) MID servers (to script) (all MIDs & MID service accounts on prod, persist through clone by design)
  • ensure SMTP & POP passwords are correct (these should survive a clone anyway) (these are set to be the same, so this is now an assumption of the script)
  • reset any user passwords for *-admin accounts (on demand... this encourages semi-regular password resets, and silent death of unused admin accounts).
  • any data sources using MID must be pointed to active/instance-specific MID server (this can be scripted, just not done yet)
  • During the interval where START Replacement catalog items must be hidden in PROD, we want to show them in TRAIN and PREPROD; even with the post-clone, you need to manually add the category Phones and Cable TV
  • Enable mail sending to DEV / TEST account
    https://wiki.servicenow.com/index.php?title=Post-Cloning_Checklist#ServiceNow_Mail_Servers