Access shared resources
We have reached the fourth appointment with NetServer. Previously we talked about:
In this article we talk about how to access shared resources via NetServer from a PC client.
Index
Access to the shared resources of the NetServer can take place in a manner temporary by accessing the resource by its name in the form of UNC ( \server-nameshare-name ) or in a way permanent by mapping the resource as a network drive.
When accessing a shared resource without providing explicit login credentials :
In some situations, even if you specify the correct user and password (and having made sure that the user is not disabled for the NetServer), Windows keeps re-proposing the window for requesting credentials. In this case you can try to precede the user name with the domain name of the server, i.e. the IP address of the IBM i server: eg. 192.168.0.1MYUSER .
| IBM i and Windows user | IBM i and Windows password | Guest user ID configured | Access granted to NetServer |
| the same | the same | no | yes with windows user |
| the same | different | no | credential requests |
| different | same or different | no | credential requests |
| the same | the same | Yes | yes with windows user |
| the same | different | Yes | credential requests |
| different | same or different | Yes | yes with guest ID user |
To map a network drive using commands run from a command prompt NET USE :
net use[device-name|*][\server-nameshare-name][password][/USER:[[domain-name] user] [/SAVECRED] [/PERSISTENT:{YES|NO}]
[password][/USER:[[domain-name]user] : Specify the server login credentials. In some situations it may be necessary to prefix the username with the domain name of the server.[/SAVECRED]: Save your server login credentials for later reuse[/PERSISTENT:{YES|NO}]: if you specify /PERSISTENT:YES the network drive will be automatically reconnected at the next logon of the PCTo disconnect a network drive:
net use[device-name] /DELETE
To disconnect all attached network drives:
net use * /DELETE
Other useful commands to manage network connections:
net view : List the servers available on the networknet view \server-name : List the shared resources of a serverFrom Windows to map a network drive:
From Windows to access a shared resource without mapping it as a network drive :
For more information on Network Drive Mapping in Windows see the Microsoft document: https://support.microsoft.com/en-gb/windows/map-a-network-drive-in-windows-29ce55d1-34e3-a7e2-4801-131475f9557d .
The NetServer service uses TCP ports 137 , 138 And 139 (NetBios) e 445 (CIFS). So if the server is on a remote network from the client protected by a firewall, you need to make sure that network traffic on those ports is allowed.
In the first article we have already covered the compatibility map between SMB on Windows clients and NetServer on IBM i. Let’s see some commands that can be useful on Windows clients to check the SMB version.
The cmdlet Get-SmbConnection tells us what version of SMB has been negotiated with the server. The command must be run with administrator rights. After connecting to a shared server resource you can run the command Get-SmbConnection .
To find out which version of SMB is running on your PC, you can access a shared resource in loopback
dir \localhostc$
and then get the information with Get-SmbConnection .
You can use the command to check if the services required to manage shared network resources are running on your PC Get-Service Lanman* :
The main page of the IBM documentation on NetServer can be consulted at this link: https://www.ibm.com/docs/en/i/7.5?topic=services-i-netserver . Other useful resources can be found in the attached document:
In the next article we will talk about how solve the most common problems concerning NetServers.
👉 Review: Bob Cozzi’s RPG IV to RPG Free Conversion – a useful VS Code extension for RPG modernization If…
Hello everyone, I’d like to highlight another excellent contribution by Massimo Duca, part of his ongoing IBM i & SQL…
Intrigued by some recent posts from Cristian Larsen on LinkedIn (New Release – Display File DDS Edit v 0.10.1), I…
Hello everyone, Today I’d like to draw your attention to a major new announcement from IBM: Project Bob — a…
I want to share with you a particularly useful article by Massimo Duca in the IBM i & SQL Tips…
Hello everyone, I’d like to highlight a very useful article by Marco Riva on Markonetools, where he clearly explains how…