So I have the following code which I believe creates a connection to the local SQL server on my machine using windows credentials.
$ServerObj = New-Object ("Microsoft.SqlServer.Management.Smo.Server") "(local)"
Is it possible to specify that I want to use server credentials to connect instead?
i.e. connect using a server username and password rather than my windows credentials