Register Services (G4MSREGSVC)

Register Service (G4MSREGSVC)

Type choices, press Enter.

Microsoft ID . . . . . . . . . . _______________________________________________

Service . . . . . . . . . . . . *ONEDRIVE

Registration Method . . . . . . *WEB *WEB, *USERPW

Tenant . . . . . . . . . . . . . 'organizations'

Password . . . . . . . . . . . .

Additional Parameters

Register for Groups . . . . . . *NO *YES, *NO

Redo Registration . . . . . . . *NO *YES, *NO

CCSID . . . . . . . . . . . . . 1252 Number

Debug . . . . . . . . . . . . . *NO *YES, *NO

Debug File . . . . . . . . . . . ______________________________________________


F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display

F24=More keys

The G4MSREGSVC command allows you to register a service with your Microsoft ID. Registering a service allows G4MS to access the functionality of this service for the ID specified using OAuth v2.0 security.

When this command is run you'll be presented with a URL to go to in your browser after first signing into your Microsoft account.

Next you'll be given a code to enter when asked. You will then be asked in the browser if you wish to grant access to G4MS to the specific service. Once complete, G4MS will have access to the particular service for your Microsoft ID.

See the example below for the flow you should expect.

  • Microsoft ID - Specify the Microsoft ID that you want to register a service for. Normally this is your Outlook address (including

  • Service - Specify the service to register.

  • Registration Method - If you want to try registering using a userid and password, specify *USERPW for this and enter the password for the account on the PASSWORD parameter. Otherwise leave this as *WEB.

  • Tenant - Normally this will be left as the default

  • Password - Enter the password for the account if registering using a password instead of the web method.

  • Register for Groups - Specify *YES if you would like to add the scopes/permissions for working with Groups.

  • Redo Registration - If you have previously registered and are re-registering because of an expired password or another update, specify *YES.

  • CCSID - Sepcify a CCSID to use for data conversions.

  • Debug - Specify *YES to turn on debugging.

  • Debug File - Enter the fully qualified name of the debug file you wish to use. If left blank, this value defaults to /tmp/g4ms_<id>_registerServiceDebug.txt.

Example of Registering the Microsoft OneDrive Application

The first thing you will want to do is issue the following command:


This will present a screen similar to the following:

Next, you will copy and paste the URL from the page to your browser's location bar. You should be presented with a page that looks like the following:

Click on the link and you'll be presented with a Microsoft Account Signon Screen:

Next you should enter your Microsoft Account userid and password where prompted. Once that is done, you'll be asked to confirm that you want G4MS to be able to access your OneDrive account information:

Select the "Yes" button and you will be redirected to a site with a confirmation code similar to the following:

Now you will want to copy the Authorization Code (in bold) from this website and paste it into the green screen we began on where noted.

Press F6 after pasting the authorization code and you should be presented with the following screen:

You are now ready to start using the Microsoft Service that was registered.