NOTE: If you are running Clean My Org on the same server, this workflow may cause issues with the application unless you also /wiki/spaces/GJKBASE/pages/648413204
- In Command Prompt, navigate to the MongoDB installation directory with mongo.exe, the default is
cd /D “C:\Program Files\MongoDB\Server\5.0\bin“ - Type mongo from this directory in the command prompt to start the mongo shell. (Note: if you are already using authentication with mongo, you will need to log in with administrator credentials.)
- Type:
use AdminTools2 - Copy and paste in the following lines:
db.createUser({"user": "admintoolsdb", "pwd":"yourpassword", roles: [{ role: "dbAdmin", db: "AdminTools2" }]})
db.grantRolesToUser("admintoolsdb", [ { role: "readWrite", db: "AdminTools2" } ]) - Type exit to leave the mongo shell.
- To enable mongoDB with authentication, edit the file in the default mongo installation directory C:\Program Files\MongoDB\Server\5.0\bin\mongod.cfg
- Find the line starting with #security and paste the following lines underneath it:
security:
authorization: enabled - Save the file and close.
- In the Admin Tools directory, edit the file called: C:\inetpub\wwwroot\admintools\app-server\config\nodeconfig.json
- Edit the “dbPath” line to read:
"url": "mongodb://admintoolsdb:yourpassword@localhost:27017/AdminTools2", - Save the file and close.
- Open Windows Services and restart the “MongoDB Server” windows service.
- Restart the “Admin Tools Server” windows service.
Related articles