Hi Philip,
Have you tried using the New-NcDirectory cmdlet instead of the New-Item cmdlet? The advantage is that New-NcDirectory uses a native ZAPI call ("file-create-directory") and you are connecting over the management LIF (https) instead of a data LIF if attempting to access the CIFS share to create the directory. Here is the source code for the command as an example:
Param(
[Parameter(Mandatory = $True, HelpMessage = "The name or IP Address of the cluster")]
[String]$ClusterName,
[Parameter(Mandatory = $True, HelpMessage = "The name of the vserver")]
[String]$VserverName,
[Parameter(Mandatory = $True, HelpMessage = "The path of the directory to create. '/vol/' will be appended to the start of the path if not specified.")]
[String]$Path,
[Parameter(Mandatory = $True, HelpMessage = "The permissions to assign to the directory")]
[String]$Permission,
[Parameter(Mandatory = $False, HelpMessage = "The maximum number of ZAPI retry attempts")]
[Int]$ZapiRetryCount
)
#'------------------------------------------------------------------------------
#'Connect to the cluster
#'------------------------------------------------------------------------------
Connect-WFACluster $ClusterName
#'------------------------------------------------------------------------------
#'Set the command to create the directory.
#'------------------------------------------------------------------------------
If(-Not($Path.StartsWith("/vol/"))){
If($Path.StartsWith("/")){
[String]$p = $Path.substring(1, ($Path.length -1))
[String]$Path = "/vol/$p"
}Else{
[String]$Path = "/vol/$Path"
}
}
[String]$command = "New-NcDirectory -Path ""$Path"" -Permission $Permission "
If($ZapiRetryCount){
[String]$command += "-ZapiRetryCount $ZapiRetryCount "
}
[String]$command += "-VserverContext $VserverName -ErrorAction Stop"
#'------------------------------------------------------------------------------
#'Create the directory.
#'------------------------------------------------------------------------------
Try{
Invoke-Expression -Command $command -ErrorAction Stop
Get-WFALogger -Info -Message "Executed Command`: $command"
Get-WFALogger -Info -Message "Created directory ""$Path"" on vserver ""$VserverName"""
}Catch{
Get-WFALogger -Info -Message $("Failed Executing Command`: $command. Error " + $_.Exception.Message)
Throw "Failed creating Directory ""$Path"" on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------
Example output:

From an NTFS perspecitve that will create a folder that has everyone full control access. EG
C:\>icacls \\vserver1\cifs_data_001$\test2
\\vserver1\cifs_data_001$\test2 Everyone:(I)(F)
Everyone:(I)(OI)(CI)(IO)(F)
Successfully processed 1 files; Failed processing 0 files
Hope that helps.
/Matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.