SharePoint – Sorting Date fields isn’t working

We ran into a scenario where several people want to be select the exact minute in the date/time fields. The OOB field only allows increments of 5 minutes (there is a check to make sure it’s divisible by 5). Many workarounds are shown on the web to create choice columns for Date, Hour, Minute, and AM/PM. Then create a calculated column to create a Date/Time field. This works except when you want to sort. The issue is with the way the calculated field is created in these posts.

Columns

Date – Date only field

Hour – Choice Field – 1, 2, 3…12

Minute – Choice Field – 00, 01, 02, 03, … 59

AM/PM – Choice Field – AM, PM

Strings vs Date/Time types

Sorting strings (single lines of text) will sort differently than Date/Time types. Let’s take an example the following dates.

01/21/2021

02/21/2019

03/18/2017

The above would be sorted based on the String type since we sort left to right. Sorting based on Date/Time would be Year->Month->Day->Hour->Minute->Second

03/18/2017

02/21/2019

01/21/2021

Calculated Column

The formula you would see would add in the columns above to get a string but the format looks correct

=TEXT(([Date],”mm/dd/yyyy”)&” “&[Hour]&”:”&[Minute]&” “&[AM/PM])

Example of what this would look like:

01/21/2021 1:21 AM

This will be treated as a string since we have =TEXT

Solution

=IF(AM/PM=”AM”,[Date]+([Hour]/24)+([Minute]/24/60),[Date]+(([Hour]+12)/24)+([Minute]/24/60))

Instead of adding things to a string we will use math to add the time into the date. The formula can only accept the increments of days so 1 AM would be 1/24 of the day. Minute would be 60 minutes in every hour and 24 hours in every day.

Hour/24

Minute/60/24

PM we would add 12 hours.

SharePoint 2013 – SafeForDataBinding and Unknown server tag ‘SharePoint:BrowseStyleBlock’.

After applying the June 2021 security update (KB 5001954), you will encounter the following issue with publishing sites:

Sorry something when wrong.

ULS:

06/12/2021 10:04:03.58        w3wp.exe (0x1C24)        0x11CC        SharePoint Foundation        General        8sl1        High

DelegateControl: Exception thrown while adding control ‘Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSource’: System.MissingMethodException: Method not found: ‘Boolean Microsoft.SharePoint.Utilities.SPUtility.SafeForDataBinding(System.Reflection.Assembly, System.Reflection.Assembly, System.String)’.

at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSource.get_PortalProvider()

at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSource.OnInit(EventArgs e)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.AddedControl(Control control, Int32 index)

at Microsoft.SharePoint.WebControls.DelegateControl.AddControlResilient(Control ctl)

06/12/2021 10:04:03.60        w3wp.exe (0x1C24)        0x11CC        SharePoint Foundation        General        8nca        Medium

Application error when access /sites/pub/Pages/default.aspx, Error=The DataSourceID of ‘TopNavigationMenu’ must be the ID of a control of type IHierarchicalDataSource. A control with ID ‘topSiteMap’ could not be found.

at System.Web.UI.WebControls.HierarchicalDataBoundControl.GetDataSource()

at System.Web.UI.WebControls.HierarchicalDataBoundControl.ConnectToHierarchicalDataSource()

at System.Web.UI.WebControls.HierarchicalDataBoundControl.OnLoad(EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

06/12/2021 10:04:03.61        w3wp.exe (0x1C24)        0x11CC        SharePoint Foundation        Runtime        tkau        Unexpected

System.Web.HttpException: The DataSourceID of ‘TopNavigationMenu’ must be the ID of a control of type IHierarchicalDataSource. A control with ID ‘topSiteMap’ could not be found.

at System.Web.UI.WebControls.HierarchicalDataBoundControl.GetDataSource()

at System.Web.UI.WebControls.HierarchicalDataBoundControl.ConnectToHierarchicalDataSource()

at System.Web.UI.WebControls.HierarchicalDataBoundControl.OnLoad(EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

06/12/2021 10:04:03.61        w3wp.exe (0x1C24)        0x11CC        SharePoint Foundation        General        ajlz0        High

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> System.Web.HttpException (0x80004005): The DataSourceID of ‘TopNavigationMenu’ must be the ID of a control of type IHierarchicalDataSource. A control with ID ‘topSiteMap’ could not be found.

at System.Web.UI.WebControls.HierarchicalDataBoundControl.GetDataSource()

at System.Web.UI.WebControls.HierarchicalDataBoundControl.ConnectToHierarchicalDataSource()

at System.Web.UI.WebControls.HierarchicalDataBoundControl.OnLoad(EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext context)

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Search Center:

ULS:

06/12/2021 10:07:21.94        w3wp.exe (0x1C24)        0x05F4        SharePoint Foundation        General        8nca        Medium

Application error when access /sites/Search/Pages/default.aspx, Error=Unknown server tag ‘SharePoint:BrowseStyleBlock’.

at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)

at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)

at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)

at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)

at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)

06/12/2021 10:07:21.94        w3wp.exe (0x1C24)        0x05F4        SharePoint Foundation        Runtime        tkau        Unexpected

System.Web.HttpException: Unknown server tag ‘SharePoint:BrowseStyleBlock’.

at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)

at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)

at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)

at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)

at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)

06/12/2021 10:07:21.94        w3wp.exe (0x1C24)        0x05F4        SharePoint Foundation        General        ajlz0        High

Getting Error Message for Exception System.Web.HttpParseException (0x80004005): Unknown server tag ‘SharePoint:BrowseStyleBlock’. —> System.Web.HttpParseException (0x80004005): Unknown server tag ‘SharePoint:BrowseStyleBlock’. —> System.Web.HttpException (0x80004005): Unknown server tag ‘SharePoint:BrowseStyleBlock’.

at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)

at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)

at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)

at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)

at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)

at System.Web.UI.TemplateParser.ProcessException(Exception ex)

at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)

at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)

at System.Web.UI.TemplateParser.ProcessException(Exception ex)

at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)

at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)

at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)

at System.Web.UI.TemplateParser.Parse()

at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()

at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)

at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()

at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()

at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)

at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)

at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)

at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)

at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)

at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)

at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Resolution for this issue:

Apply June 2021 CU for SharePoint 2013 – June 8, 2021, cumulative update for SharePoint Enterprise Server 2013 (KB5001961) (microsoft.com)

SharePoint 2019 – Unable to Open Visio Files in Browser

Ran into a new issue with Visio Service Application and SharePoint 2016/2019. The failure is with trying to open Visio files in the browser.

The Document can’t be opened because it is not a supported Visio diagram.

Make Sure that the “Web Drawing URL” web part setting is set to a valid VSDX, VSDM, or VDW file.

We know that it’s a valid file since we can open it with Viso outside of the browser.

In the ULS logs we can see we fail with a permission issue trying to open the Content Database. This will happen if you’re running your Visio service application pool with a different account than the web application’s application pool.

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC SharePoint Foundation Database 880i High System.Data.SqlClient.SqlException (0x80131904): Cannot open database “WSS_Content” requested by the login. The login failed. Login failed for user ‘Contoso\WebServiceAccount’. at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.SharePoint.Utilities.SqlSession.OpenConnection() ClientConnectionId:4fc5e745-930d-48c7-bd5f-29416551fc91 Error Number:4060,State:1,Class:11 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC SharePoint Foundation Database 880k High at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, Boolean retryForDeadLock) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command) at Microsoft.SharePoint.Upgrade.SPDatabaseSequence.GetVersion(SPDatabase database, Guid id, Version defaultVersion, SqlSession session, SPDatabaseSequence sequence) at Microsoft.SharePoint.Administration.SPDatabase.get_BuildVersion() at Microsoft.SharePoint.Administration.SPContentDatabase.get_StoredProceduresSchemaVersion() at Microsoft.SharePoint.Administration.SPContentDatabase.get_SupportsGetSecureUrlForDocId() at Microsoft.SharePoint.SPFile.EnsureWebRelativeUrl() at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean throwException) at Microsoft.SharePoint.SPFile.get_Exists() at Microsoft.Office.Visio.Server.GraphicsServer.SharePointFile.GetFile(Uri requestedFileUrl, Object userToken, String fileGuid) at Microsoft.Office.Visio.Server.GraphicsServer.DocumentManager.GetRasterPage(RasterPageRequest request, GetRasterDiagramCallback callback, ReaderWriterFlags& rwflags) at Microsoft.Office.Visio.Server.GraphicsServer.ServiceCore.GetRasterPage(RasterPageRequest request) at Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsService.GetRasterPage(RasterPageRequest request) at SyncInvokeGetRasterPage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.SecurityChannelListener`1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item) at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread) at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread) at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread) at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result) at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result) at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.HttpInput.ParseMessageAsyncResult.OnRead(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Web.Hosting.AsyncResultBase.Complete(Int32 hresult, Boolean synchronous) at System.Web.Hosting.PipelineRuntime.AsyncCompletionHandler(IntPtr rootedObjectsPointer, Int32 bytesCompleted, Int32 hresult, IntPtr pAsyncCompletionContext) 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC SharePoint Foundation Database 880j High SqlError: ‘Cannot open database “WSS_Content” requested by the login. The login failed.’ Source: ‘.Net SqlClient Data Provider’ Number: 4060 State: 1 Class: 11 Procedure: ” LineNumber: 65536 Server: ‘sql.contoso.com’ 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC SharePoint Foundation Database 880j High SqlError: ‘Login failed for user ‘Contoso\WebServiceAccount’.’ Source: ‘.Net SqlClient Data Provider’ Number: 18456 State: 1 Class: 14 Procedure: ” LineNumber: 65536 Server: ‘sql.contoso.com’ 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC SharePoint Foundation Database 3760 Critical SQL Database ‘WSS_Content’ on SQL Server instance ‘sql.contoso.com’ not found. Additional error information from SQL Server is included below. Cannot open database “WSS_Content” requested by the login. The login failed. Login failed for user ‘Contoso\WebServiceAccount’. 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC Visio Graphics Service Graphics Service 8061 Critical File not found at this location: https://sp/Docs/Test.vsdx Exception : Cannot retrieve the file 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.47 w3wp.exe (0x3254) 0x35DC Visio Graphics Service Graphics Service 8079 Critical Failed to generate raster diagram for file https://sp/Docs/Test.vsdx page -1 Error : System.ServiceModel.FaultException`1[Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault]: The creator of this fault did not specify a Reason. (Fault Detail is equal to Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault). 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.48 w3wp.exe (0x2650) 0x3748 Visio Graphics Service Web Access aputu High GetRasterPage Failed: Exception=System.ServiceModel.FaultException`1[Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault]: The creator of this fault did not specify a Reason. (Fault Detail is equal to Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault). 4477b79f-24a2-70c6-0173-a2d4bb51b53f

03/24/2021 13:28:14.48 w3wp.exe (0x2650) 0x3748 Visio Graphics Service Web Access 8078 Critical Failed to get raster diagram for visio file https://sp/Docs/Test.vsdx page default page ID Exception : System.ServiceModel.FaultException`1[Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault]: The creator of this fault did not specify a Reason. (Fault Detail is equal to Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault). 4477b79f-24a2-70c6-0173-a2d4bb51b53f

To fix this script will add in that account to all the content databases

Add-PSSnapin *sh*


$vsa = Get-SPServiceApplication | ? {$_.TypeName -eq "Visio Graphics Service Application"}
$svcAccountName = $vsa.ApplicationPool.ProcessAccount.Name

Write-Host "Found the account $svcAccountName running application pool for Visio"
$yn = Read-host -Prompt "Would you like to apply AdminShell for account $svcAccountName to all content databases? Y/N"
If($yn -eq "y")
{

}
Else
{
    break
}

$cdbs = Get-SPContentDatabase -NoStatusFilter

Foreach($cdb in $cdbs)
{

    Try
    {
        Write-Host "Applying permissions for database $($cdb.Name)"
        Add-SPShellAdmin -UserName $SvcAccountName -database $cdb
        Write-Host "Sucessfully applied permissions for database $($cdb.Name)" -ForegroundColor Green
    }
    Catch
    {
        Write-Host "Failed to apply for database $($cdb.Name)" -ForegroundColor DarkRed
        Write-Host $_

    }

}

SharePoint 2019 – Anonymous Prompting for Credentials

SharePoint 2019 introduced Modern pages. With this, we see an additional permission that needs to be set.

There are two ways to address this prompting issue.

Add the UserRemoteAPIs permission to Anonymouspermmask64

$site = Get-SPSite http://sharepoint
$site.rootweb.AnonymousPermMask64+=[Microsoft.SharePoint.SPBasePermissions]::UseRemoteAPIs
$site.rootweb.Update()

-OR-

Uncheck the box for “Require Use Remote Interfaces permissions”

Site Settings -> Site Permissions -> Anonymous Access (in the ribbon)


This can also be unchecked using PowerShell:

$site = Get-SPSite http://sharepoint
$site.UpdateClientObjectModelUseRemoteAPIsPermissionSetting($false