# Connect to Administrative Shares using credentials from 1Password

**URL:** <https://resource.dopus.com/t/connect-to-administrative-shares-using-credentials-from-1password/60838>\
**Category:** Buttons/Scripts\
**Created:** [November 4, 2026, 4:52am UTC](https://resource.dopus.com/t/connect-to-administrative-shares-using-credentials-from-1password/60838 "2026-11-04T04:52:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoxedMug](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/58956e/32.png) [@BoxedMug](https://resource.dopus.com/u/BoxedMug)\
**Post date:** [November 4, 2026, 4:52am UTC](https://resource.dopus.com/t/connect-to-administrative-shares-using-credentials-from-1password/60838/1 "2026-11-04T04:52:48Z")

</div>

Connect to normal and administrative shares like `\\hostname\c$` with a credential from 1Password.

It will:

- open each share in a new tab
- reuse the credential across all connections
- assume a hostname is an administrative share and convert it from `hostname` to `\\hostname\c$`

The intended use case is calling it from Powershell, with a function that's loaded by your profile. This function could be called by a different function that looks up a users machine from their name.

Example profile function

```auto
function Enter-NetworkShare
{
    [alias("ens")]
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
        [ValidateNotNullorEmpty()]
        # designed for passing the entire share like `\\hostname\c$` but the Directory Opus script
        # is fine with receiving just a hostname cause it'll wrap the rest around if it's missing
        [string[]]$Shares
    )
    
    process {
        $SharesList = @()
        $Shares | Foreach-Object {
            $_ -match "^(?:\\\\|)([-a-zA-Z0-9]+)(?:\\|$)" | Out-Null
            $name = $Matches[1]
            $Matches.Clear()
            
            if( Test-Connection -Quiet -Count 1 -ComputerName $name )
            {
                $SharesList += $_
            }
            else
            {
                Write-Host "Couldn't reach $name" -ForegroundColor Red
            }
        }
        
        $SharesString = $SharesList -join ','
        & $directoryOpusRTPath /cmd:active ConnectToNetworkShares /SHARES $SharesString /CREDENTIALNAME "Optional Credential Name"
    }
}

Enter-NetworkShare -Shares "\\hostname\c$","hostname2"

```

**Requirements**

- 1Password CLI must be installed and configured
- Replace "Default 1Password Credential Name Here" with the default credential name to use

This is my first time sharing anything so I hope I got the format right.  
I thought about splitting this out into separate commands for re-usability, but that would make sharing harder.

[ConnectToNetworkShares\_1.0.0.ouc](https://resource.dopus.com/uploads/short-url/pHGJuJ7L6rsH5anHUMzNVkhA4uA.ouc) (12.5 KB)
