Net Use or alternative Java/Groovy for establishing credentials on a shared drive
Hello friends in the TR TechOverflow community! My SoapUI script will delete current credentials to a shared drive & establish new ones to ensure we're connecting to "\\
clnt-corp-e0562.int.westgroup.com\\caymanci\$" with a service account. My preferred languages to accomplish this task are Groovy & Java, but I got better search results for the "NET USE" so far. So to clarify, the following is the road I've started down, but if you've got other solutions outside of Windows shell networking, I'm happier with that. So far, **c:> net use "\\
clnt-corp-e0562.int.westgroup.com\caymanci$" /delete** (& iterations thereof) result in "The network connection could not be found. More help is available by typing NET HELPMSG 2250" in the command line. I've also attempted escaping special characters and specifying the domain, all with similar results. Once I've made this concept work, I'll throw the solution into my Groovy script. Are there any Java/Groovy/SoapUI/Networking gurus out there who'd suggest a better solution than putting this in my test suite's Setup Script / know how to fix my NET USE command here? Thank you, G
clnt-corp-e0562.int.westgroup.com\\caymanci\$" with a service account. My preferred languages to accomplish this task are Groovy & Java, but I got better search results for the "NET USE" so far. So to clarify, the following is the road I've started down, but if you've got other solutions outside of Windows shell networking, I'm happier with that. So far, **c:> net use "\\
clnt-corp-e0562.int.westgroup.com\caymanci$" /delete** (& iterations thereof) result in "The network connection could not be found. More help is available by typing NET HELPMSG 2250" in the command line. I've also attempted escaping special characters and specifying the domain, all with similar results. Once I've made this concept work, I'll throw the solution into my Groovy script. Are there any Java/Groovy/SoapUI/Networking gurus out there who'd suggest a better solution than putting this in my test suite's Setup Script / know how to fix my NET USE command here? Thank you, G
Tagged:
1
Best Answer
-
Try doing just **net use** to see the list of connections that are currently present. I tried this and it worked: C:\Users\######>net use \\
clnt-corp-e0562.int.westgroup.com\caymanci$ Enter the user name for '
clnt-corp-e0562.int.westgroup.com': mgmt\m###### Enter the password for
clnt-corp-e0562.int.westgroup.com: The command completed successfully. C:\Users\######>net use New connections will be remembered. Status Local Remote Network ------------------------------------------------------------------------------- OK \\
clnt-corp-e0562.int.westgroup.com\caymanci$ Microsoft Windows Network OK \\homedir\###### Microsoft Windows Network The command completed successfully. C:\Users\######>net use "\\
clnt-corp-e0562.int.westgroup.com\caymanci$" /delete \\
clnt-corp-e0562.int.westgroup.com\caymanci$ was deleted successfully.1
Answers
-
Thank you Bhavin! Your solution is *perfect.* When I first looked at it, I was like "I know this; this would only get me halfway there if it even works." But seeing that you tried the solution & it worked for you was encouraging & the non-specific error I was getting using the /delete switch happens only when I haven't explicitly NET USEd the share in the same DOS window. In other words, I was attempting to /delete the pre-existing credentials I knew I'd mapped to the share via another Windows method & that 1st /delete command always gave the error: "The network connection could not be found." On this point alone, I mistakenly assumed I wasn't specifying the shared drive name correctly. Another lesson that I shouldn't doubt myself just because Windows shell doesn't give a helpful error message or know its own connections. **Persistence pays off.** Here is the SoapUI code I'm using so far in my suite Startup script: def delCredentials = "net use \\\\
caymanstorage.int.westgroup.com\\caymanci\$ /delete" delCredentials.execute() *//if this causes an error, it's likely bc the mapping doesn't need deletion anyway; no need to report; continue script.* def newCredentials = "net use \\\\
caymanstorage.int.westgroup.com\\caymanci\$ /USER:ECOMQC\\[service account name] [password]" newCredentials.execute() *//explicitly connect to the drive with the service account provided.* If anyone knows another/better solution, please post it here or on the hub. Thanks again T.Overflow community!1
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛