How-To: SMB connection URL from Mac OS X 10.5/10.6/10.7/10.8 to Windows Server 2003/2008

If you are writing applications or scripts which install volumes or printer shares offered by a Windows Server on a Mac OS X Client, this could be the perfect confusion. It made me nearly crazy because with every combination of the two companies‘ systems things work differently. In fact, the SMB URL has to be adapted to each combination.

Below you find a table with each combination’s URL (directly tested in praxis and not taken from some theoretical manual). Examples are below the table.

Syntax Combination Table

Mac OS X Windows Server SMB URL
10.4 2003 smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename>
10.5 smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename>
10.6 smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename>
10.7 smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename>
10.8 smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename>
10.4 2008 smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename>
10.5 smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename>
10.6 smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename>
10.7 smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename>
10.8 smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename>

Values in []-brackets are optional (like the port number); <>-brackets enclose a variable value and have to be replaced with their variable label. Mac OS X 10.8 is not tested, yet. I’ll update the post in a few days when I’ll the possibility to check under Mountain Lion. Update: Mountain Lion settings are tested now and they work.

Examples

smb://mydomain;john.doe:nicepassword@printerhost:139/colorprinter
smb://john.doe:nicepassword@mydomain/printerhost:139/colorprinter
smb://john.doe:nicepassword@printerhost:139/colorprinter (without domain)
smb://john.doe:nicepassword@printerhost/colorprinter (without domain and port number)
smb://printerhost/colorprinter (no domain, user and port number)

[amazon_omakase size=“728×90″ locale=““ ad_logo=“hide“ ad_product_images=“show“ ad_link_target=“new“ ad_price=“all“ ad_border=“hide“ ad_discount=“add“ color_border=“000000″ color_background=“FFFFFF“ color_text=“000000″ color_link=“333333″ color_price=“660000″ color_logo=“FFFFFF“ /]

6 Kommentare

  1. Daniel
    | Permalink

    Hello Mike,
    Thx for the nice overview. Are you sure that Os X support SMB? I tried to use an external HDD on my network switch but can’t connect from OS x 10.8 but win 7 works.
    So i read that 10.8 doesn’t support smb1 (only a own version of Apples smb2).
    Is there any hint i can’t find?

    Greetings from germany

    • master
      | Permalink

      Hi,
      yes I’m sure that SMB is supported. Surely there are some bugs in Apple’s own implementation (SMBX) compared to SAMBA which they’ve used before. But in general it’s compatible and I’ve experienced no problems so far.
      Mostly it’s a problem of addressing correctly; finding the right URL syntax could be tricky. Maybe you could send me what Windows shows as SMB URL and than we can find the right syntax for Mountain Lion.

      Greets
      Mike

  2. Jason
    | Permalink

    Thank you! This has been a bear to get working reliably again- 10.8 can be quite picky

    • Mike Battistella
      | Permalink

      That’s right. It took me several hours to figure every combination out.

  3. King Herod
    | Permalink

    If you do not want to supply your password, or you want to store the link in the Connect To Server window sans your cleartext password, just omit the password, but not the (:) colon. In 10.5/10.6, you could just have username@servername.

    smb://username:@servername/sharename

    I’ve been connecting using this for some time just using the FQDN instead of declaring the domain as shown above. Lots of options.

  4. Jan Hacker
    | Permalink

    If you’re curios about implementation details and want to know the difference between cifs:// and smb://, take a look at Developer SMB documentation.
    Nice blog, Mike! (google took me here 😉
    Cheers, Jan

Einen Kommentar hinterlassen

Ihre E-Mail wird niemals veröffentlicht oder weitergegeben. Erforderliche Felder sind mit * markiert

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*

Ich stimme der Datenschutzerklärung zu

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.