$Uri = 'https://www.contoso.com';
$request = [System.Net.WebRequest]::Create($Uri);
$request.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$response = $request.GetResponse();
(($request.ServicePoint).Certificate).GetExpirationDateString();
其中 ($request.ServicePoint).Certificate.Subject 可以核對 FQDN
沒有留言:
張貼留言